GNOME Bugzilla – Bug 795117
jpegparse: Fix the code to handle APP1 marker segment skipping
Last modified: 2018-04-16 21:44:16 UTC
The Jpegparse code is not repositioning the bytereader before skipping and that causes errors in jpeg decode pipelines. Streams are attached here: https://bugzilla.gnome.org/show_bug.cgi?id=793787
Created attachment 370715 [details] [review] jpegparse: Fix APP1 marker segment parsing
Review of attachment 370715 [details] [review]: ::: gst/jpegformat/gstjpegparse.c @@ +575,3 @@ + /* restore the byte position and size */ + reader->size += 2; + reader->byte -= 2; rather than modify the internal state of the reader why not just skip the reported marker size, something like GST_DEBUG_OBJECT (parse, "unhandled marker %x skiping %u bytes", APP1, size); if (!gst_byte_reader_skip (reader, size)) return FALSE;
(In reply to Víctor Manuel Jáquez Leal from comment #2) > Review of attachment 370715 [details] [review] [review]: > > ::: gst/jpegformat/gstjpegparse.c > @@ +575,3 @@ > + /* restore the byte position and size */ > + reader->size += 2; > + reader->byte -= 2; > > rather than modify the internal state of the reader why not just skip the > reported marker size, something like > > GST_DEBUG_OBJECT (parse, "unhandled marker %x skiping %u bytes", APP1, > size); > if (!gst_byte_reader_skip (reader, size)) > return FALSE; No, it won't work, the immediate call to gst_jpeg_parse_skip_marker() has to retrieve the size of the header from the first two bytes.
Review of attachment 370715 [details] [review]: Pushed as, commit 9a090538be874d1d5031b1a225e8ee9d767603c3