Mercurial > geeqie
comparison src/bar_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 | ee2b66a09a03 |
children | 20963c5d332c |
comparison
equal
deleted
inserted
replaced
1660:da8afd03152f | 1661:13ff1db545f6 |
---|---|
492 if (!pane) return; | 492 if (!pane) return; |
493 | 493 |
494 g_free(ee->key); | 494 g_free(ee->key); |
495 ee->key = g_strdup(gtk_entry_get_text(GTK_ENTRY(cdd->key_entry))); | 495 ee->key = g_strdup(gtk_entry_get_text(GTK_ENTRY(cdd->key_entry))); |
496 title = gtk_entry_get_text(GTK_ENTRY(cdd->title_entry)); | 496 title = gtk_entry_get_text(GTK_ENTRY(cdd->title_entry)); |
497 if (strcmp(ee->title, title) != 0) | 497 if (!title || strlen(title) == 0) |
498 { | |
499 g_free(ee->title); | |
500 ee->title = exif_get_description_by_key(ee->key); | |
501 ee->auto_title = TRUE; | |
502 } | |
503 else if (!ee->title || strcmp(ee->title, title) != 0) | |
498 { | 504 { |
499 g_free(ee->title); | 505 g_free(ee->title); |
500 ee->title = g_strdup(title); | 506 ee->title = g_strdup(title); |
501 ee->auto_title = FALSE; | 507 ee->auto_title = FALSE; |
502 } | 508 } |