avformat/utils: Fix potential integer overflow in extract_extradata()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 0a41a8bf29)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
7f521fae2b
commit
eb495b20e5
1 changed files with 3 additions and 1 deletions
|
|
@ -3542,7 +3542,9 @@ static int extract_extradata(AVStream *st, AVPacket *pkt)
|
|||
&extradata_size);
|
||||
|
||||
if (extradata) {
|
||||
i->avctx->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
av_assert0(!i->avctx->extradata);
|
||||
if ((unsigned)extradata_size < FF_MAX_EXTRADATA_SIZE)
|
||||
i->avctx->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!i->avctx->extradata) {
|
||||
av_packet_unref(pkt_ref);
|
||||
return AVERROR(ENOMEM);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue