/* EOF */
if (start_code < 0) {
goto the_end;
+ } else if (unescaped_buf_size > (1U<<29)) {
+ av_log(avctx, AV_LOG_ERROR, "MJPEG packet 0x%x too big (0x%x/0x%x), corrupt data?\n",
+ start_code, unescaped_buf_ptr, buf_size);
+ return AVERROR_INVALIDDATA;
} else {
av_log(avctx, AV_LOG_DEBUG, "marker=%x avail_size_in_buf=%td\n",
start_code, buf_end - buf_ptr);