summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-31 19:16:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-02-23 14:28:10 +0100
commit8c6a976feeea8ee0ccdb31fbddb0d9c98b44ae0d (patch)
tree23a9cc9b07b26ca27567b1828bd1263fc98ac4d1
parentac38860ec959bff3189364b4c6773851f389a3b6 (diff)
downloadffmpeg-8c6a976feeea8ee0ccdb31fbddb0d9c98b44ae0d.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> (cherry picked from commit f58eab151214d2d35ff0973f2b3e51c5eb372da4) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/takdec.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libavcodec/takdec.c b/libavcodec/takdec.c
index 77de4c095f..b3a7e3a5f3 100644
--- a/libavcodec/takdec.c
+++ b/libavcodec/takdec.c
@@ -720,11 +720,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);