aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2018-08-23 23:50:28 -0300
committerJames Almer <jamrial@gmail.com>2018-08-24 13:21:10 -0300
commit701aca55fd1186e440a5b208374d4754c9181f80 (patch)
treebdba4a6819beda737afe3621ce04e14453ba8a18 /libavformat
parent7890181d7e76a74fdb7a50785fc4178ed8491171 (diff)
downloadffmpeg-701aca55fd1186e440a5b208374d4754c9181f80.tar.gz
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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/flvdec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 93c7f85237..a2dea464e3 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -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);