mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-02-13 19:05:37 +00:00
avcodec/mpeg12dec: check slice size before trying to decode it
Fixes assertion failure Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
6a64b23d93
commit
9706401927
1 changed files with 5 additions and 0 deletions
|
|
@ -2299,6 +2299,11 @@ static int decode_chunks(AVCodecContext *avctx,
|
|||
if (s2->picture_structure == PICT_BOTTOM_FIELD)
|
||||
mb_y++;
|
||||
|
||||
if (buf_end - buf_ptr < 2) {
|
||||
av_log(s2->avctx, AV_LOG_ERROR, "slice too small\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (mb_y >= s2->mb_height) {
|
||||
av_log(s2->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s2->mb_height);
|
||||
return -1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue