summaryrefslogtreecommitdiffstats
path: root/libavcodec/alsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-09-08 22:02:44 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-09-08 22:16:48 +0200
commit037422178d7f1d0dd09e1ce424dd61a69e77668b (patch)
tree6e768b57fc92f0dc40b302430059faf9afaa6efc /libavcodec/alsdec.c
parent2d3099ad8ee67a4612633ea02c7fce10e5537579 (diff)
downloadffmpeg-streaming-037422178d7f1d0dd09e1ce424dd61a69e77668b.zip
ffmpeg-streaming-037422178d7f1d0dd09e1ce424dd61a69e77668b.tar.gz
avcodec/alsdec: Fix reading 0 mantisse bits
Fixes assertion failure Fixes: 848c24abc1721c9e3d1ba7bfee8d9fcc/asan_heap-oob_1d99eca_3709_567bba70d67e7d62714dcf56f26fb1da.mp4 Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/alsdec.c')
-rw-r--r--libavcodec/alsdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c
index 1bb71f5..8c4ff53 100644
--- a/libavcodec/alsdec.c
+++ b/libavcodec/alsdec.c
@@ -1527,7 +1527,7 @@ static int read_diff_float_data(ALSDecContext *ctx, unsigned int ra_frame) {
if (!get_bits1(gb)) { //uncompressed
for (i = 0; i < frame_length; ++i) {
if (ctx->raw_samples[c][i] != 0) {
- raw_mantissa[c][i] = get_bits(gb, nbits[i]);
+ raw_mantissa[c][i] = nbits[i] ? get_bits(gb, nbits[i]) : 0;
}
}
} else { //compressed
OpenPOWER on IntegriCloud