Commit 95d1b932 authored by Thiago Santos's avatar Thiago Santos

jpegdec: Prevent crash when reading image with problems

Check if we have data on the adapter and fail if not.

Fixes #627413
parent 94eddc11
......@@ -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,
dec->rem_img_len);
if (av == 0) {
GST_DEBUG_OBJECT (dec, "Out of data");
return FALSE;
}
if (dec->rem_img_len < av)
av = dec->rem_img_len;
dec->rem_img_len -= av;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment