projects
/
platform
/
upstream
/
libexif.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6de5f4d
)
do not memmove if i was the last slot, since it
author
Marcus Meissner
<marcus@jet.franken.de>
Sat, 26 Jul 2008 14:26:43 +0000
(16:26 +0200)
committer
Marcus Meissner
<marcus@jet.franken.de>
Sat, 26 Jul 2008 14:26:43 +0000
(16:26 +0200)
is already gone (and we get -1*sizeof(ExifEntry*)
as size)
libexif/exif-content.c
patch
|
blob
|
history
diff --git
a/libexif/exif-content.c
b/libexif/exif-content.c
index
4b346b3
..
7e1d9b4
100644
(file)
--- a/
libexif/exif-content.c
+++ b/
libexif/exif-content.c
@@
-175,7
+175,8
@@
exif_content_remove_entry (ExifContent *c, ExifEntry *e)
}
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);