Two defects in EGifPutImageDesc, both about error handling the function does
correctly elsewhere. One patch per finding attached.
Writing a second descriptor while an image is open therefore succeeds
silently, and giflib's own reader then rejects the file: DGifSlurp returns
D_GIF_ERR_READ_FAILED with ImageCount 0. The patch checks for outstanding
pixels instead; a finished image has PixelCount 0, so animations are
unaffected.
make check is unchanged at 51 tests, 0 failures. Both proof-of-concept
programs are attached; each carries a control case, so a broken harness
cannot pass as a result.
The suite drives the command line tools and compiles nothing, so there is no
place for a C-level regression test in the current style. Happy to add one if
you want the suite extended that way.
Patch #37 retypes PixelCount in this same function. That does not reach
finding 1: the bound comes from the 16-bit width and height fields, not from
the type. The two changes touch different lines.