diff mbox series

[FFmpeg-devel] cfhd decoder fixes for old codebook

Message ID CAPYw7P48XEW=oLVnhFDtcFos_Z5bTqJJ9_F5Engeg7z2UPi9sg@mail.gmail.com
State New
Headers show
Series [FFmpeg-devel] cfhd decoder fixes for old codebook | expand

Checks

Context Check Description
yinshiyou/configure_loongarch64 warning Failed to apply patch
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Paul B Mahol Sept. 3, 2022, 9:09 a.m. UTC
Attached.

Comments

Kieran Kunhya Sept. 3, 2022, 11:01 a.m. UTC | #1
On Sat, 3 Sept 2022 at 11:06, Paul B Mahol <onemda@gmail.com> wrote:

> Attached.
>

Ok
diff mbox series

Patch

From 64a2e914bb2d0e4833266a51ee2ada3bb8b36e9e Mon Sep 17 00:00:00 2001
From: Paul B Mahol <onemda@gmail.com>
Date: Sat, 3 Sep 2022 11:06:14 +0200
Subject: [PATCH 2/2] avcodec/cfhd: fix escape handling for old codebook

Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/cfhd.c     | 2 +-
 libavcodec/cfhddata.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c
index f908aaf8fb..e72512707e 100644
--- a/libavcodec/cfhd.c
+++ b/libavcodec/cfhd.c
@@ -819,7 +819,7 @@  static int cfhd_decode(AVCodecContext *avctx, AVFrame *pic,
                                    VLC_BITS, 3, 1);
 
                         /* escape */
-                        if (level == 64)
+                        if (level == 64 && run == 2)
                             break;
 
                         count += run;
diff --git a/libavcodec/cfhddata.c b/libavcodec/cfhddata.c
index 8079fdf542..67bd8e66db 100644
--- a/libavcodec/cfhddata.c
+++ b/libavcodec/cfhddata.c
@@ -72,7 +72,7 @@  static const uint16_t table_9_vlc_run[NB_VLC_TABLE_9] = {
     1,    1,    1,    1,    1,    1,    1,    1,
     1,    1,    1,    1,    1,    1,    1,    1,
     1,    1,    1,    1,    1,    1,    1,    1,
-    1,    1
+    1,    2,
 };
 
 static const uint8_t table_9_vlc_level[NB_VLC_TABLE_9] = {
-- 
2.37.2