Browse Source

packets with half pcm samples are invalid

Originally committed as revision 7900 to svn://svn.ffmpeg.org/ffmpeg/trunk
tags/v0.5
Michael Niedermayer 19 years ago
parent
commit
b2a581dc71
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      libavcodec/pcm.c

+ 6
- 0
libavcodec/pcm.c View File

@@ -410,6 +410,12 @@ static int pcm_decode_frame(AVCodecContext *avctx,
samples = data;
src = buf;

n= av_get_bits_per_sample(avctx->codec_id)/8;
if(n && buf_size % n){
av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
return -1;
}

buf_size= FFMIN(buf_size, *data_size/2);
*data_size=0;



Loading…
Cancel
Save