GetByteStr returns -1 on error, However this return value is ignored wherever the GetByteStr is called.
This leads to the buffer being uninitialized, which leads to incorrect control flow in the application.
For example, in GetGifWord, the byte buffer will be uninitialized.
if(--context->restbyte == 0) {
context->restbyte = GetByte(i->parent);
#if defined(DEBUG) && !defined(NGIFLIB_NO_FILE)
if(i->parent->log) fprintf(i->parent->log, "restbyte = %02X\n", context->restbyte);
#endif /* defined(DEBUG) && !defined(NGIFLIB_NO_FILE) */
GetByteStr(i->parent, context->byte_buffer, context->restbyte); <- return value ignored
context->srcbyte = context->byte_buffer; <- buffer reused
}