diff --git a/gst/jpegformat/gstjpegparse.c b/gst/jpegformat/gstjpegparse.c index 9892ed846f..64818cd3a0 100644 --- a/gst/jpegformat/gstjpegparse.c +++ b/gst/jpegformat/gstjpegparse.c @@ -318,7 +318,7 @@ gst_jpeg_parse_match_next_marker (const guint8 * data, guint size) if (G_UNLIKELY (gst_jpeg_parse_parse_tag_has_entropy_segment (tag))) { while (!(data[marker_len] == 0xff && data[marker_len + 1] != 0x00)) { ++marker_len; - if (G_UNLIKELY (marker_len > size)) + if (G_UNLIKELY (marker_len + 2 > size)) goto need_more_data; } }