lavf/vividas: Do not increase extradata_size after allocation.
authorCarl Eugen Hoyos <ceffmpeg@gmail.com>
Sat, 22 Dec 2018 23:34:57 +0000 (00:34 +0100)
committerCarl Eugen Hoyos <ceffmpeg@gmail.com>
Thu, 27 Dec 2018 23:20:41 +0000 (00:20 +0100)
Avoids a crash in avcodec_parameters_from_context().

libavformat/vividas.c

index e199b05..00a1a0f 100644 (file)
@@ -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;
         }
     }