Commit 53f658b1 authored by michael's avatar michael

packets with half pcm samples are invalid


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@7900 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 20b04b9b
...@@ -410,6 +410,12 @@ static int pcm_decode_frame(AVCodecContext *avctx, ...@@ -410,6 +410,12 @@ static int pcm_decode_frame(AVCodecContext *avctx,
samples = data; samples = data;
src = buf; 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); buf_size= FFMIN(buf_size, *data_size/2);
*data_size=0; *data_size=0;
......
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