From: Lutz M. <lu...@us...> - 2008-02-16 19:11:47
|
Update of /cvsroot/libexif/libexif/libexif/olympus In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv25655/libexif/olympus Modified Files: exif-mnote-data-olympus.c Log Message: 2008-02-16 Lutz Mueller <lu...@us...> Jan Patera <pa...@pi...> spotted a problem with my last fix for #1774591: * libexif/exif-content.c: (exif_content_remove_entry) Recover correctly in case of error by remembering the original size of the realloc'ed data. * libexif/exif-data.c: (exif_data_save_data_entry), (exif_data_save_data_content) Same here. * libexif/canon/exif-mnote-data-canon.c: (exif_mnote_data_canon_save), (exif_mnote_data_canon_load) Same here. * libexif/fuji/exif-mnote-data-fuji.c: (exif_mnote_data_fuji_save), (exif_mnote_data_fuji_load) Same here. * libexif/olympus/exif-mnote-data-olympus.c: (exif_mnote_data_olympus_save) Same here. Index: exif-mnote-data-olympus.c =================================================================== RCS file: /cvsroot/libexif/libexif/libexif/olympus/exif-mnote-data-olympus.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -p -d -r1.32 -r1.33 --- exif-mnote-data-olympus.c 10 Nov 2007 08:02:33 -0000 1.32 +++ exif-mnote-data-olympus.c 16 Feb 2008 19:11:41 -0000 1.33 @@ -88,6 +88,8 @@ exif_mnote_data_olympus_save (ExifMnoteD ExifMnoteDataOlympus *n = (ExifMnoteDataOlympus *) ne; unsigned int i, o, s, doff, base = 0, o2 = 6 + 2; int datao = 0; + unsigned char *t; + unsigned int ts; if (!n || !buf || !buf_size) return; @@ -173,10 +175,12 @@ exif_mnote_data_olympus_save (ExifMnoteD n->entries[i].components; if (s > 4) { doff = *buf_size; - *buf_size += s; - *buf = exif_mem_realloc (ne->mem, *buf, - sizeof (char) * *buf_size); - if (!*buf) return; + ts = *buf_size + s; + t = exif_mem_realloc (ne->mem, *buf, + sizeof (char) * ts); + if (!t) return; + *buf = t; + *buf_size = ts; exif_set_long (*buf + o, n->order, datao + doff); } else doff = o; |