[FFmpeg-devel] avcodecc/dnxhddec: fix ACT checking

Submitted by Paul B Mahol on Sept. 16, 2019, 3:34 p.m.

Details

Message ID 20190916153405.10364-1-onemda@gmail.com
State New
Headers show

Commit Message

Paul B Mahol Sept. 16, 2019, 3:34 p.m.
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/dnxhddec.c | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index 1e95086696..512accadfd 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -499,19 +499,17 @@  static int dnxhd_decode_macroblock(const DNXHDContext *ctx, RowContext *row,
         qscale = get_bits(&row->gb, 11);
     }
     act = get_bits1(&row->gb);
-    if (act) {
-        if (!ctx->act) {
-            static int act_warned;
-            if (!act_warned) {
-                act_warned = 1;
-                av_log(ctx->avctx, AV_LOG_ERROR,
-                       "ACT flag set, in violation of frame header.\n");
-            }
-        } else if (row->format == -1) {
-            row->format = act;
-        } else if (row->format != act) {
-            row->format = 2; // Variable
+    if (ctx->act != act) {
+        static int act_warned;
+        if (!act_warned) {
+            act_warned = 1;
+            av_log(ctx->avctx, AV_LOG_ERROR,
+                   "ACT flag set, in violation of frame header.\n");
         }
+    } else if (row->format == -1) {
+        row->format = act;
+    } else if (row->format != act) {
+        row->format = 2; // Variable
     }
 
     if (qscale != row->last_qscale) {