summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/vmdav.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c
index ec7c967f74..7006f61f2b 100644
--- a/libavcodec/vmdav.c
+++ b/libavcodec/vmdav.c
@@ -618,7 +618,7 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, void *data,
/* decode audio chunks */
if (audio_chunks > 0) {
buf_end = buf + buf_size;
- while (buf < buf_end) {
+ while ( buf_end - buf >= s->chunk_size) {
if (s->out_bps == 2) {
decode_audio_s16(output_samples_s16, buf, s->chunk_size,
avctx->channels);