comparison src/exif.c @ 1661:13ff1db545f6

Fix two memory failures 1. if the description field for a exif information is empty the program dumps core when trying to change this. The reason is a strcmp with a NULL value. The fix add the small functionality to set the field to default when it is set empty. 2. There was a g_strdup miss in exif.c which could end in memory corruption.
author mow
date Sun, 21 Jun 2009 22:52:08 +0000
parents df4e69170f2b
children 59c72fd324ce
comparison
equal deleted inserted replaced
1660:da8afd03152f 1661:13ff1db545f6
1514 } 1514 }
1515 1515
1516 i = 0; 1516 i = 0;
1517 while (ExifKnownGPSInfoMarkersList[i].tag > 0) 1517 while (ExifKnownGPSInfoMarkersList[i].tag > 0)
1518 { 1518 {
1519 if (strcmp(key, ExifKnownGPSInfoMarkersList[i].key) == 0) return _(ExifKnownGPSInfoMarkersList[i].description); 1519 if (strcmp(key, ExifKnownGPSInfoMarkersList[i].key) == 0) return g_strdup(_(ExifKnownGPSInfoMarkersList[i].description));
1520 i++; 1520 i++;
1521 } 1521 }
1522 1522
1523 return NULL; 1523 return NULL;
1524 } 1524 }