mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-19 15:15:12 +08:00
utils: Check for extradata size overflows.
This commit is contained in:
@@ -2442,9 +2442,11 @@ int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
|
||||
}
|
||||
if(st->parser && st->parser->parser->split && !st->codec->extradata){
|
||||
int i= st->parser->parser->split(st->codec, pkt->data, pkt->size);
|
||||
if(i){
|
||||
if (i > 0 && i < FF_MAX_EXTRADATA_SIZE) {
|
||||
st->codec->extradata_size= i;
|
||||
st->codec->extradata= av_malloc(st->codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
if (!st->codec->extradata)
|
||||
return AVERROR(ENOMEM);
|
||||
memcpy(st->codec->extradata, pkt->data, st->codec->extradata_size);
|
||||
memset(st->codec->extradata + i, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
}
|
||||
|
Reference in New Issue
Block a user