summaryrefslogtreecommitdiffstats
path: root/libavcodec/adxdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-01-07 16:05:56 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-01-07 16:05:56 +0100
commit8aead3ffa89a7d92b54b049a63bf6485f643835b (patch)
treef3637858255d6f9b2b8757c6c412f39a689fc176 /libavcodec/adxdec.c
parent2303b45112b4c9097a661998f3d9ebe81eea2cac (diff)
downloadffmpeg-streaming-8aead3ffa89a7d92b54b049a63bf6485f643835b.zip
ffmpeg-streaming-8aead3ffa89a7d92b54b049a63bf6485f643835b.tar.gz
avformat/adxdec: dont return random data on EOF
Fixes use of uninitialized memory Partly fixes; msan_uninit-mem_7fb7d24780d0_2744_R03T.CAK Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/adxdec.c')
-rw-r--r--libavcodec/adxdec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c
index e59cc92..ec33e73 100644
--- a/libavcodec/adxdec.c
+++ b/libavcodec/adxdec.c
@@ -157,9 +157,11 @@ static int adx_decode_frame(AVCodecContext *avctx, void *data,
buf_size -= BLOCK_SIZE;
buf += BLOCK_SIZE;
}
- samples_offset += BLOCK_SAMPLES;
+ if (!c->eof)
+ samples_offset += BLOCK_SAMPLES;
}
+ frame->nb_samples = samples_offset;
*got_frame_ptr = 1;
return buf - avpkt->data;
OpenPOWER on IntegriCloud