[libav-stable] [PATCH] mpeg4videodec: raise an error if sprite_trajectory.table is NULL

Sean McGovern gseanmcg at gmail.com
Thu Mar 30 22:21:38 CEST 2017


CC: libav-stable at libav.org
Bug-Id: 1012
---
This patch stops the crash from Bugzilla #1012, however, the real issue is:
mpeg4videodec.c:decode_init() needs to be called somewhere before the call to
av_parser_parse2() in libavformat/utils.c:parse_packet()
---
 libavcodec/mpeg4videodec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 8891ec1..2be68ee 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -186,6 +186,10 @@ static int mpeg4_decode_sprite_trajectory(Mpeg4DecContext *ctx, GetBitContext *g
     if (w <= 0 || h <= 0)
         return AVERROR_INVALIDDATA;
 
+    /* the decoder was not properly intialized and we cannot continue */
+    if (sprite_trajectory.table == NULL)
+        return AVERROR_INVALIDDATA;
+
     for (i = 0; i < ctx->num_sprite_warping_points; i++) {
         int length;
         int x = 0, y = 0;
-- 
1.7.9.2



More information about the libav-stable mailing list