From 796fdbdf17f36db2f1b4dbaa3593f345d0e3440f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 13 Oct 2008 08:15:13 +0000 Subject: [PATCH] gst-libs/gst/tag/tags.c: Don't drop the last byte of image tags if they're not an URI list. Original commit message from CVS: * gst-libs/gst/tag/tags.c: (gst_tag_image_data_to_image_buffer): Don't drop the last byte of image tags if they're not an URI list. Fixes bug #556066. --- ChangeLog | 6 ++++++ gst-libs/gst/tag/tags.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8719e98c6b..a5be1ec499 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-10-13 Sebastian Dröge + + * gst-libs/gst/tag/tags.c: (gst_tag_image_data_to_image_buffer): + Don't drop the last byte of image tags if they're not an URI list. + Fixes bug #556066. + 2008-10-13 Sebastian Dröge * gst/typefind/gsttypefindfunctions.c: (flac_type_find): diff --git a/gst-libs/gst/tag/tags.c b/gst-libs/gst/tag/tags.c index 0afbb6b2d4..b7c6f92f70 100644 --- a/gst-libs/gst/tag/tags.c +++ b/gst-libs/gst/tag/tags.c @@ -410,7 +410,7 @@ gst_tag_image_data_to_image_buffer (const guint8 * image_data, memcpy (GST_BUFFER_DATA (image), image_data, image_data_len); GST_BUFFER_DATA (image)[image_data_len] = '\0'; - GST_BUFFER_SIZE (image) = image_data_len; + GST_BUFFER_SIZE (image) = image_data_len + 1; /* Find GStreamer media type, can't trust declared type */ caps = gst_type_find_helper_for_buffer (NULL, image, NULL); @@ -434,7 +434,7 @@ gst_tag_image_data_to_image_buffer (const guint8 * image_data, * to keep the original size of the image */ if (!g_str_equal (name, "text/uri-list")) - GST_BUFFER_SIZE (image) = GST_BUFFER_SIZE (image) - 1; + GST_BUFFER_SIZE (image) = image_data_len; if (image_type != GST_TAG_IMAGE_TYPE_NONE) { GST_LOG ("Setting image type: %d", image_type);