fix for memory allocation of thumbs

This commit is contained in:
Jan Rinze
2010-11-02 18:56:56 +01:00
parent 28e6c919c5
commit ee0095daa7
2 changed files with 865 additions and 889 deletions

View File

@@ -9197,15 +9197,21 @@ rtengine::Thumbnail* rtengine::Thumbnail::loadQuickFromRaw (const Glib::ustring&
rml.ciffBase = ciff_base;
rml.ciffLength = ciff_len;
char thumb_buffer[thumb_length];
char *thumb_buffer malloc(thumb_length+64); // malloc instead of on the stack.
if ( thumb_buffer == NULL )
{
printf("DCRAW: failed3\n");
return NULL;
}
fseek(ifp,thumb_offset,SEEK_SET);
fread(thumb_buffer,1,thumb_length,ifp);
fclose(ifp);
rtengine::Thumbnail* tpp = rtengine::Thumbnail::loadFromMemory(thumb_buffer,thumb_length,w,h,fixwh);
free(thumb_buffer);
if ( tpp == 0 )
{
printf("DCRAW: failed3\n");
printf("DCRAW: failed4\n");
return NULL;
}

File diff suppressed because it is too large Load Diff