mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
jpegdec: when scanning for 0xff marker ends, ensure desired result
Otherwise, any non 0xff byte at end of data would be mistaken for a tag byte, and in case of a frame_len 0 tag subsequently lead to an infinite loop.
This commit is contained in:
parent
52482a3741
commit
7a89fb0468
1 changed files with 4 additions and 0 deletions
|
@ -433,6 +433,10 @@ gst_jpeg_dec_parse_image_data (GstJpegDec * dec)
|
|||
/* at the very least we expect 0xff 0xNN, thus end-1 */
|
||||
while (*data != 0xff && data < end - 1)
|
||||
++data;
|
||||
if (G_UNLIKELY (*data != 0xff)) {
|
||||
GST_DEBUG ("at end of input and no next marker found, need more data");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
/* Skip over extra 0xff */
|
||||
while (*data == 0xff && data < end)
|
||||
|
|
Loading…
Reference in a new issue