Menu ▾ ▴

#93 Segfault on Corrupt Animated GIF

None
closed
5
2015-03-15
2014-07-20
Anonymous
No

PluginGIF.cpp can segfault when reading a corrupt animated GIF using the GIF_PLAYBACK flag. There is a for loop in PluginGIF.cpp (v3.16.0 line 803) which copies pageline to scanline. When scanline is calculated, it is possible for "logicalheight - (y + info.top) - 1" to calculated -1. If anything < 0 is calculated, the four loop should break. This same scanline calculation is used during the much rarer GIF_DISPOSAL_BACKGROUND processing, and should be fixed there as well (v3.16.0 line 776). I've tested the attached code with an offending corrupt animated GIF, and it fixes the segfault.

1 Attachments

Discussion

  • Hervé Drolon

    Hervé Drolon - 2014-07-20
    • status: open --> pending
    • assigned_to: Hervé Drolon
    • Group: -->
     
  • Hervé Drolon

    Hervé Drolon - 2014-07-20

    Hi Aaron,

    Thanks for the patchn it is now available in the CVS.

    Hervé

     
    • Aaron Shumate

      Aaron Shumate - 2014-07-21

      Thank you for incorporating the fix, for the quick response, and as always for FreeImage!

       
  • Hervé Drolon

    Hervé Drolon - 2015-03-15

    fixed in release 3.17.0

     
  • Hervé Drolon

    Hervé Drolon - 2015-03-15
    • status: pending --> closed
     

Anonymous
Anonymous

Add attachments
Cancel