Commit 701aca55 authored by James Almer's avatar James Almer

avformat/flvdec: don't propagate empty extradata

Fixes ticket #7379
Reviewed-by: 's avatarPaul B Mahol <onemda@gmail.com>
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
parent 7890181d
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment