diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-31 19:16:02 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-31 19:54:27 +0100 |
commit | f58eab151214d2d35ff0973f2b3e51c5eb372da4 (patch) | |
tree | 7130e910ee1199d35dd2adab5f3c09e828f20710 /libavcodec/takdec.c | |
parent | 0de9d72b7c000f8abdee8b3a90b13896fff41147 (diff) | |
download | ffmpeg-f58eab151214d2d35ff0973f2b3e51c5eb372da4.tar.gz |
avcodec/takdec: always check bits_per_raw_sample
Fixes out of array access
Fixes: asan_heap-oob_19c7a94_6470_cov_1453611734_luckynight-partial.tak
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/takdec.c')
-rw-r--r-- | libavcodec/takdec.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c index fcbe10ad3c..86ca3ac013 100644 --- a/libavcodec/takdec.c +++ b/libavcodec/takdec.c @@ -721,11 +721,9 @@ static int tak_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_INVALIDDATA; } - if (s->ti.bps != avctx->bits_per_raw_sample) { - avctx->bits_per_raw_sample = s->ti.bps; - if ((ret = set_bps_params(avctx)) < 0) - return ret; - } + avctx->bits_per_raw_sample = s->ti.bps; + if ((ret = set_bps_params(avctx)) < 0) + return ret; if (s->ti.sample_rate != avctx->sample_rate) { avctx->sample_rate = s->ti.sample_rate; set_sample_rate_params(avctx); |