avcodec/smacker: Check init_get_bits8() for failure
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 3 Sep 2015 23:18:13 +0000 (01:18 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 4 Sep 2015 00:15:50 +0000 (02:15 +0200)
Fixes: CID1322314

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/smacker.c

index 6709f97..b2fc29b 100644 (file)
@@ -316,7 +316,9 @@ static int decode_header_trees(SmackVContext *smk) {
     full_size = AV_RL32(smk->avctx->extradata + 8);
     type_size = AV_RL32(smk->avctx->extradata + 12);
 
-    init_get_bits8(&gb, smk->avctx->extradata + 16, smk->avctx->extradata_size - 16);
+    ret = init_get_bits8(&gb, smk->avctx->extradata + 16, smk->avctx->extradata_size - 16);
+    if (ret < 0)
+        return ret;
 
     if(!get_bits1(&gb)) {
         av_log(smk->avctx, AV_LOG_INFO, "Skipping MMAP tree\n");