Browse Source

vmdaudio: set *data_size to zero when skipping small packets and add a warning log message.

Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
tags/n0.8
Justin Ruggles Ronald S. Bultje 15 years ago
parent
commit
7a4fb3fd93
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      libavcodec/vmdav.c

+ 4
- 1
libavcodec/vmdav.c View File

@@ -514,8 +514,11 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx,
/* point to the start of the encoded data */
const unsigned char *p = buf + 16;

if (buf_size < 16)
if (buf_size < 16) {
av_log(avctx, AV_LOG_WARNING, "skipping small junk packet\n");
*data_size = 0;
return buf_size;
}

block_type = buf[6];
if (block_type < BLOCK_TYPE_AUDIO || block_type > BLOCK_TYPE_SILENCE) {


Loading…
Cancel
Save