#113 FreeImage_CloseMultiBitmap crash

open
nobody
None
5
2012-10-31
2008-09-22
No

Steps to reproduce:
- create a TIFF image (probably other formats would work) "sample.tiff";
- create and keep open in exclusive mode (no sharing allowed) a file named "sample.ficache";
- call img = FreeImage_OpenMultiBitmap (FIF_TIFF, "sample.tiff", 0, 0, 0, 0, 0), it returns FIMULTIBITMAP != NULL;
- call FreeImage_CloseMultiBitmap (img, 0)
- witness the invalid pointer operation.

The problem most likely comes from the FreeImage_OpenMultiBitmap: when it fails to open the locked cache file (if (cache_file->open())...). It then deletes the "header" and returns the "bitmap" variable with bitmap->header still pointing to the released memory. If probably should return NULL or, better yet, gracefully revert to using memory cache.

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks