Commit ac55c612 authored by michael's avatar michael

Do not discard truncated packets.

Based on a patch by Maksym Veremeyenko verem DOT m1stereo AT tv


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@18626 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 615dd6c6
...@@ -361,8 +361,11 @@ static int pcm_decode_frame(AVCodecContext *avctx, ...@@ -361,8 +361,11 @@ static int pcm_decode_frame(AVCodecContext *avctx,
n = avctx->channels * sample_size; n = avctx->channels * sample_size;
if(n && buf_size % n){ if(n && buf_size % n){
if (buf_size < n) {
av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n"); av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
return -1; return -1;
}else
buf_size -= buf_size % n;
} }
buf_size= FFMIN(buf_size, *data_size/2); buf_size= FFMIN(buf_size, *data_size/2);
......
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