[FFmpeg-cvslog] dnxhddec: check that the indicated bit depth matches the tables.

Michael Niedermayer git at videolan.org
Sat Apr 21 21:57:42 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr 21 21:39:18 2012 +0200| [6c0027bb3971dc9a06b5847c51a106e10c7b6fcb] | committer: Michael Niedermayer

dnxhddec: check that the indicated bit depth matches the tables.

Fixes crash

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/dnxhddec.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c
index aeb4b3d..4b23380 100644
--- a/libavcodec/dnxhddec.c
+++ b/libavcodec/dnxhddec.c
@@ -82,6 +82,10 @@ static int dnxhd_init_vlc(DNXHDContext *ctx, int cid)
             av_log(ctx->avctx, AV_LOG_ERROR, "unsupported cid %d\n", cid);
             return -1;
         }
+        if (ff_dnxhd_cid_table[index].bit_depth != ctx->bit_depth) {
+            av_log(ctx->avctx, AV_LOG_ERROR, "bit depth mismatches %d %d\n", ff_dnxhd_cid_table[index].bit_depth, ctx->bit_depth);
+            return AVERROR_INVALIDDATA;
+        }
         ctx->cid_table = &ff_dnxhd_cid_table[index];
 
         ff_free_vlc(&ctx->ac_vlc);



More information about the ffmpeg-cvslog mailing list