Menu ▾ ▴

#7 DDS patch for bad DDS files

closed
None
5
2012-10-31
2006-02-20
swilcox
No

If FreeImage encounters an invalid DDS file, such as
one with zero length, the behavior is undefined. This
is due to a structure not being properly initialized.
The structure in question is DDSHEADER.

The fix:

In plugindds.cpp in the Load(...) function you will
find this line:
DDSHEADER header;

Add this line immediately following:
memset(&header, 0, sizeof(header));

The same issue exists in Validate(...). The fix is the
same. Add memset(&header, 0, sizeof(header))
immediately following DDSHEADER header.

Discussion

  • Hervé Drolon

    Hervé Drolon - 2006-02-25

    Logged In: YES
    user_id=613758

    Hi,

    Thanks again for this patch.
    It has just been added to the CVS.

    Hervé Drolon

     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     

Anonymous
Anonymous

Add attachments
Cancel