diff --git a/src/add-ons/translators/gif/GIFLoad.cpp b/src/add-ons/translators/gif/GIFLoad.cpp index 37a84be5b9..5f061d8cd5 100644 --- a/src/add-ons/translators/gif/GIFLoad.cpp +++ b/src/add-ons/translators/gif/GIFLoad.cpp @@ -344,7 +344,8 @@ GIFLoad::ReadGIFImageData() { unsigned char newEntry[ENTRY_COUNT]; unsigned char codeSize; - fInput->Read(&codeSize, 1); + if (fInput->Read(&codeSize, 1) < 1) + return false; if (codeSize > fPalette->size_in_bits) { if (debug) {