mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 18:05:37 +00:00
jpegdec: Prevent crash when reading image with problems
Check if we have data on the adapter and fail if not. Fixes #627413
This commit is contained in:
parent
94eddc119f
commit
95d1b932ab
1 changed files with 5 additions and 0 deletions
|
@ -211,6 +211,11 @@ gst_jpeg_dec_fill_input_buffer (j_decompress_ptr cinfo)
|
||||||
GST_DEBUG_OBJECT (dec, "fill_input_buffer: fast av=%u, remaining=%u", av,
|
GST_DEBUG_OBJECT (dec, "fill_input_buffer: fast av=%u, remaining=%u", av,
|
||||||
dec->rem_img_len);
|
dec->rem_img_len);
|
||||||
|
|
||||||
|
if (av == 0) {
|
||||||
|
GST_DEBUG_OBJECT (dec, "Out of data");
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if (dec->rem_img_len < av)
|
if (dec->rem_img_len < av)
|
||||||
av = dec->rem_img_len;
|
av = dec->rem_img_len;
|
||||||
dec->rem_img_len -= av;
|
dec->rem_img_len -= av;
|
||||||
|
|
Loading…
Reference in a new issue