1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avformat/flvdec: don't propagate empty extradata

Fixes ticket #7379

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2018-08-23 23:50:28 -03:00
parent 7890181d7e
commit 701aca55fd

View File

@ -753,6 +753,9 @@ static int flv_read_close(AVFormatContext *s)
static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
{
if (!size)
return 0;
av_freep(&st->codecpar->extradata);
if (ff_get_extradata(s, st->codecpar, s->pb, size) < 0)
return AVERROR(ENOMEM);
@ -763,6 +766,9 @@ static int flv_get_extradata(AVFormatContext *s, AVStream *st, int size)
static int flv_queue_extradata(FLVContext *flv, AVIOContext *pb, int stream,
int size)
{
if (!size)
return 0;
av_free(flv->new_extradata[stream]);
flv->new_extradata[stream] = av_mallocz(size +
AV_INPUT_BUFFER_PADDING_SIZE);