mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-09 16:50:01 +00:00
avformat/utils: Fix potential integer overflow in extract_extradata()
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
b4a1ccfc41
commit
0a41a8bf29
@ -3544,7 +3544,9 @@ static int extract_extradata(AVStream *st, AVPacket *pkt)
|
|||||||
&extradata_size);
|
&extradata_size);
|
||||||
|
|
||||||
if (extradata) {
|
if (extradata) {
|
||||||
sti->avctx->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
av_assert0(!sti->avctx->extradata);
|
||||||
|
if ((unsigned)extradata_size < FF_MAX_EXTRADATA_SIZE)
|
||||||
|
sti->avctx->extradata = av_mallocz(extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||||
if (!sti->avctx->extradata) {
|
if (!sti->avctx->extradata) {
|
||||||
av_packet_unref(pkt_ref);
|
av_packet_unref(pkt_ref);
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
Loading…
Reference in New Issue
Block a user