From: Marcus M. <mar...@us...> - 2008-07-26 14:26:47
|
Update of /cvsroot/libexif/libexif/libexif In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6796 Modified Files: exif-content.c Log Message: do not memmove if i was the last slot, since it is already gone (and we get -1*sizeof(ExifEntry*) as size) Index: exif-content.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/exif-content.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -p -d -r1.27 -r1.28 --- exif-content.c 26 Jul 2008 07:56:45 -0000 1.27 +++ exif-content.c 26 Jul 2008 14:26:43 -0000 1.28 @@ -175,7 +175,8 @@ exif_content_remove_entry (ExifContent * } c->entries = t; c->count--; - memmove (&t[i], &t[i + 1], sizeof (ExifEntry*) * (c->count - i - 1)); + if (i!=c->count) /* we deallocated the last slot already */ + memmove (&t[i], &t[i + 1], sizeof (ExifEntry*) * (c->count - i - 1)); t[c->count-1] = temp; } else { exif_mem_free (c->priv->mem, c->entries); |