diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-21 21:39:18 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-21 21:39:18 +0200 |
commit | 6c0027bb3971dc9a06b5847c51a106e10c7b6fcb (patch) | |
tree | d50f2a48cd671f3727f2c052a4d6f3f3ba74b15a /libavcodec | |
parent | 8c59e0c362b948a746392b65932dd1cfeab8076c (diff) | |
download | ffmpeg-6c0027bb3971dc9a06b5847c51a106e10c7b6fcb.tar.gz |
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@gmx.at>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/dnxhddec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index aeb4b3d6ab..4b2338001c 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); |