4xm: check the return value of read_huffman_tables().
authorAnton Khirnov <anton@khirnov.net>
Wed, 13 Feb 2013 19:46:08 +0000 (20:46 +0100)
committerAnton Khirnov <anton@khirnov.net>
Sat, 23 Feb 2013 08:13:08 +0000 (09:13 +0100)
CC:libav-stable@libav.org

libavcodec/4xm.c

index fa5256c..82f8417 100644 (file)
@@ -721,6 +721,10 @@ static int decode_i_frame(FourXContext *f, const uint8_t *buf, int length)
     }
 
     prestream = read_huffman_tables(f, prestream);
+    if (!prestream) {
+        av_log(f->avctx, AV_LOG_ERROR, "Error reading Huffman tables.\n");
+        return AVERROR_INVALIDDATA;
+    }
 
     init_get_bits(&f->gb, buf + 4, 8 * bitstream_size);