Commit f86d66bc authored by Anton Khirnov's avatar Anton Khirnov

vmdaudio: fix invalid reads when packet size is not a multiple of chunk size

CC:libav-stable@libav.org
parent 4c0080b7
...@@ -627,7 +627,7 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data, ...@@ -627,7 +627,7 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data,
/* decode audio chunks */ /* decode audio chunks */
if (audio_chunks > 0) { if (audio_chunks > 0) {
buf_end = buf + buf_size; buf_end = buf + buf_size;
while (buf < buf_end) { while (buf + s->chunk_size <= buf_end) {
if (s->out_bps == 2) { if (s->out_bps == 2) {
decode_audio_s16(output_samples_s16, buf, s->chunk_size, decode_audio_s16(output_samples_s16, buf, s->chunk_size,
avctx->channels); avctx->channels);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment