History

avcodec/mpeg4videoenc: Check extradata malloc()

Fixes: Null pointer dereference Fixes: any mpeg4 testcase which fails the malloc at that exact spot

Michael Niedermayer committed 5 years ago

Commit 33a16871 parent 92fde251 file · +2 −0Browse files

Unified · Split

libavcodec/mpeg4videoenc.c+2−0
@@ -1304,6 +1304,8 @@ static av_cold int encode_init(AVCodecContext *avctx) · 1303 unmodified lines
1304 1304
1305 if (s->avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {1305 if (s->avctx->flags & AV_CODEC_FLAG_GLOBAL_HEADER) {
1306 s->avctx->extradata = av_malloc(1024);1306 s->avctx->extradata = av_malloc(1024);
1307 if (!s->avctx->extradata)
1308 return AVERROR(ENOMEM);
1307 init_put_bits(&s->pb, s->avctx->extradata, 1024);1309 init_put_bits(&s->pb, s->avctx->extradata, 1024);
1308 1310
1309 if (!(s->workaround_bugs & FF_BUG_MS))1311 if (!(s->workaround_bugs & FF_BUG_MS))

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