correct my fault here and documnet the sense of the test

This commit is contained in:
Marcus Boerger 2003-01-18 19:06:29 +00:00
parent 310397f2ee
commit 9d02c2bd56

View File

@ -1486,15 +1486,14 @@ static int exif_file_sections_realloc(image_info_type *ImageInfo, int section_in
{
void *tmp;
/* This is not a malloc/realloc check. It is a plausibility check for the
* function parameters (requirements engineering).
*/
if (section_index >= ImageInfo->file.count) {
EXIF_ERRLOG_FSREALLOC
return -1;
}
tmp = erealloc(ImageInfo->file.list[section_index].data, size);
if (size == 0 || section_index >= ImageInfo->file.count) {
return -1;
}
tmp = erealloc(ImageInfo->file.list[section_index].data, size);
ImageInfo->file.list[section_index].data = tmp;
ImageInfo->file.list[section_index].size = size;
return 0;