History

avcodec/mpeg12dec: Check input size

Fixes: Timeout Fixes: 53599/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_IPU_fuzzer-4950102511058944

Michael Niedermayer committed 3 years ago

Commit 7c130d61 parent f669dd41 file · +4 −0Browse files

Unified · Split

libavcodec/mpeg12dec.c+4−0
@@ -2956,6 +2956,10 @@ static int ipu_decode_frame(AVCodecContext *avctx, AVFrame *frame, · 2955 unmodified lines
29562956 GetBitContext *gb = &m->gb;
29572957 int ret;
29582958
2959+ // Check for minimal intra MB size (considering mb header, luma & chroma dc VLC, ac EOB VLC)
2960+ if (avpkt->size*8LL < (avctx->width+15)/16 * ((avctx->height+15)/16) * (2 + 3*4 + 2*2 + 2*6))
2961+ return AVERROR_INVALIDDATA;
2962+
29592963 ret = ff_get_buffer(avctx, frame, 0);
29602964 if (ret < 0)
29612965 return ret;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t