avcodec/imc: dont read bits beyond the end
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 17 Dec 2014 03:51:06 +0000 (04:51 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 17 Dec 2014 04:14:11 +0000 (05:14 +0100)
Fixes use of uninitialized memory

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/imc.c

index b367ccb..a3254f1 100644 (file)
@@ -808,9 +808,8 @@ static void imc_get_coeffs(AVCodecContext *avctx,
                         av_log(avctx, AV_LOG_WARNING,
                             "Potential problem on band %i, coefficient %i"
                             ": cw_len=%i\n", i, j, cw_len);
-                    }
-
-                    cw = get_bits(&q->gb, cw_len);
+                    } else
+                        cw = get_bits(&q->gb, cw_len);
                 }
 
                 chctx->codewords[j] = cw;