From: Sebastian W. <se...@se...> - 2004-01-28 20:46:14
|
Hi, exif kept on dumping core on me, so I decided to go searching for the culprit and here it is (BTW: valgrind really rocks): Index: exif/main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvsroot/libexif/exif/exif/main.c,v retrieving revision 1.37 diff -u -r1.37 main.c --- exif/main.c 30 Sep 2003 22:43:00 -0000 1.37 +++ exif/main.c 28 Jan 2004 20:35:27 -0000 @@ -109,7 +109,7 @@ */ if (e->format =3D=3D EXIF_FORMAT_ASCII) { if (e->data) free (e->data); - e->components =3D strlen (e->data) + 1; + e->components =3D strlen (set_value) + 1; e->size =3D strlen (set_value) + 1; e->data =3D malloc (sizeof (char) * e->size); if (!e->data) { What a trivial bug, but so hard to find. And before I forget: Thanks for libexif. Ah, and another remark: sizeof (char) =3D=3D 1. Always. Thats guaranteed by the standard. That libexif (and most probably 90% of the existing software which reads/writes binary data from/to files etc.) would stop working with a char size of more then 8 bit is quite obvious. Bye, Sebastian --=20 Sebastian Wilhelmi | h=E4r ovanf=F6r alla molnen mailto:se...@se... | =E4r himmlen s=E5 f=F6runderligt b= l=E5 http://seppi.de | |