mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 10:11:08 +00:00
jpegdec: Fix invalid memory access by first checking and then reading
Fixes bug #610483.
This commit is contained in:
parent
3ab666762f
commit
ad05705afb
1 changed files with 2 additions and 2 deletions
|
@ -486,10 +486,10 @@ gst_jpeg_dec_parse_image_data (GstJpegDec * dec)
|
|||
GST_DEBUG ("0x%08" G_GINT64_MODIFIER "x: finding entropy segment length",
|
||||
(gint64) (data - start - 1));
|
||||
while (1) {
|
||||
if (d2[eseglen] == 0xff && d2[eseglen + 1] != 0x00)
|
||||
break;
|
||||
if (d2 + eseglen >= end - 1)
|
||||
return 0; /* need more data */
|
||||
if (d2[eseglen] == 0xff && d2[eseglen + 1] != 0x00)
|
||||
break;
|
||||
++eseglen;
|
||||
}
|
||||
frame_len += eseglen;
|
||||
|
|
Loading…
Reference in a new issue