[FFmpeg-cvslog] avcodec/cfhd: fix escape handling for old codebook

Paul B Mahol git at videolan.org
Sat Sep 3 15:48:28 EEST 2022


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sat Sep  3 11:06:14 2022 +0200| [4beac58e901ac4ffc6d264ae0a5a98ed76e73447] | committer: Paul B Mahol

avcodec/cfhd: fix escape handling for old codebook

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4beac58e901ac4ffc6d264ae0a5a98ed76e73447
---

 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] = {



More information about the ffmpeg-cvslog mailing list