From 17aed996bc35a020416e10075f1e6cc61b6cf805 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Sun, 23 Dec 2018 00:34:57 +0100 Subject: lavf/vividas: Do not increase extradata_size after allocation. Avoids a crash in avcodec_parameters_from_context(). --- libavformat/vividas.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libavformat/vividas.c') diff --git a/libavformat/vividas.c b/libavformat/vividas.c index e199b05d69..00a1a0f6ef 100644 --- a/libavformat/vividas.c +++ b/libavformat/vividas.c @@ -392,7 +392,8 @@ static void track_header(VividasDemuxContext *viv, AVFormatContext *s, uint8_t offset += data_len[j]; } - st->codecpar->extradata_size = offset; + if (offset < st->codecpar->extradata_size) + st->codecpar->extradata_size = offset; } } -- cgit v1.2.1