[gstreamer-bugs] [Bug 626618] jpegparse doesn't handle APP12 marker
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Fri Nov 19 09:40:34 PST 2010
https://bugzilla.gnome.org/show_bug.cgi?id=626618
GStreamer | gst-plugins-bad | git
--- Comment #51 from Víctor Manuel Jáquez Leal <vjaquez at igalia.com> 2010-11-19 17:40:29 UTC ---
(In reply to comment #46)
> Review of attachment 174667 [details]:
>
> ::: gst/jpegformat/gstjpegparse.c
> @@ +604,3 @@
> + GST_MEMDUMP ("comment", data, size);
> + if (s && !g_utf8_validate (s, size, NULL))
> + return NULL;
>
> I have done quite some research on that and as far as I know this is just
> ascii. Have you found any spec saying that this is UTF8? Sure, valid ascii is
> also valid utf8.
I've a couple images with the char 0x20 as only comment and the taglist
complains about a non-utf8 char:
(gst-launch-0.10:18556): GStreamer-WARNING **: Trying to set string on taglist
field 'comment', but string is not valid UTF-8. Please file a bug.
Bearing that in mind I validate for utf8 chars. And now it works.
>
> @@ +640,3 @@
> + parse->priv->srcpad, tags);
> +
> + g_slice_free (char, comment);
>
> I think this is not correct - it would need to be e.g. char[20]. I would just
> use an ordinary g_strdup above and g_free here.
As a I copy (in order to modify it) the string with g_slice_copy, it must be
free with g_slice_free. I imagine it would have better performance than a
g_strdup/g_free
+ /* as the string may not end in NUL, we must allocate a new string */
+ str = g_slice_copy (size, s);
+ str[size] = '\0';
If you think it is not useful, I can change it.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the Gstreamer-bugs
mailing list