imc: fix order of operations in coefficients read
authorVittorio Giovara <vittorio.giovara@gmail.com>
Mon, 13 Oct 2014 14:42:28 +0000 (15:42 +0100)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Wed, 15 Oct 2014 13:48:07 +0000 (14:48 +0100)
Reported-by: Ruoyu <liangry@ucweb.com>
libavcodec/imc.c

index 41ca8c8..500f564 100644 (file)
@@ -873,14 +873,14 @@ static int imc_decode_block(AVCodecContext *avctx, IMCContext *q, int ch)
 
     flag = get_bits1(&q->gb);
     if (stream_format_code & 0x1)
-        imc_decode_level_coefficients_raw(q, chctx->levlCoeffBuf,
-                                          chctx->flcoeffs1, chctx->flcoeffs2);
-    else if (stream_format_code & 0x1)
         imc_read_level_coeffs_raw(q, stream_format_code, chctx->levlCoeffBuf);
     else
         imc_read_level_coeffs(q, stream_format_code, chctx->levlCoeffBuf);
 
-    if (stream_format_code & 0x4)
+    if (stream_format_code & 0x1)
+        imc_decode_level_coefficients_raw(q, chctx->levlCoeffBuf,
+                                          chctx->flcoeffs1, chctx->flcoeffs2);
+    else if (stream_format_code & 0x4)
         imc_decode_level_coefficients(q, chctx->levlCoeffBuf,
                                       chctx->flcoeffs1, chctx->flcoeffs2);
     else