Browse Source

vmdaudio: validate block type

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit 22f893e1c9)
tags/n0.8
Justin Ruggles Michael Niedermayer 15 years ago
parent
commit
ebed7b6865
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/vmdav.c

+ 4
- 0
libavcodec/vmdav.c View File

@@ -518,6 +518,10 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx,
return buf_size;

block_type = buf[6];
if (block_type < BLOCK_TYPE_AUDIO || block_type > BLOCK_TYPE_SILENCE) {
av_log(avctx, AV_LOG_ERROR, "unknown block type: %d\n", block_type);
return AVERROR(EINVAL);
}

if (block_type == BLOCK_TYPE_AUDIO) {
/* the chunk contains audio */


Loading…
Cancel
Save