diff options
author | Thiago Santos <ts.santos@sisa.samsung.com> | 2014-04-22 00:21:01 -0300 |
---|---|---|
committer | Thiago Santos <ts.santos@sisa.samsung.com> | 2014-04-22 00:54:26 -0300 |
commit | 6e39dd853eaef11d39ee9915f1117dc841a82e43 (patch) | |
tree | 159e642c6afbff367e561ccfeb5b7b9f2bd16b25 | |
parent | 0d637424fcee717dcab9532f67cb4d05631b7038 (diff) | |
download | gstreamer-plugins-base-6e39dd853eaef11d39ee9915f1117dc841a82e43.tar.gz |
tag: exif: avoid adding empty strings
Fixes assertion with some jpeg files
-rw-r--r-- | gst-libs/gst/tag/gstexiftag.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gst-libs/gst/tag/gstexiftag.c b/gst-libs/gst/tag/gstexiftag.c index 0d4a47801..49e327059 100644 --- a/gst-libs/gst/tag/gstexiftag.c +++ b/gst-libs/gst/tag/gstexiftag.c @@ -1279,8 +1279,9 @@ parse_exif_ascii_tag (GstExifReader * reader, const GstExifTagMatch * tag, GST_WARNING ("Failed to parse %s into a datetime tag", utfstr); } } else if (tagtype == G_TYPE_STRING) { - gst_tag_list_add (reader->taglist, GST_TAG_MERGE_REPLACE, tag->gst_tag, - utfstr, NULL); + if (utfstr[0] != '\0') + gst_tag_list_add (reader->taglist, GST_TAG_MERGE_REPLACE, tag->gst_tag, + utfstr, NULL); } else { GST_WARNING ("No parsing function associated to %x(%s)", tag->exif_tag, tag->gst_tag); @@ -1364,8 +1365,9 @@ parse_exif_undefined_tag (GstExifReader * reader, const GstExifTagMatch * tag, gst_sample_unref (sample); gst_buffer_unref (buf); } else if (tagtype == G_TYPE_STRING) { - gst_tag_list_add (reader->taglist, GST_TAG_MERGE_REPLACE, tag->gst_tag, - data, NULL); + if (data[0] != '\0') + gst_tag_list_add (reader->taglist, GST_TAG_MERGE_REPLACE, tag->gst_tag, + data, NULL); } else { GST_WARNING ("No parsing function associated to %x(%s)", tag->exif_tag, tag->gst_tag); |