[FFmpeg-cvslog] r18626 - trunk/libavcodec/pcm.c

michael subversion
Sun Apr 19 22:40:56 CEST 2009


Author: michael
Date: Sun Apr 19 22:40:56 2009
New Revision: 18626

Log:
Do not discard truncated packets.
Based on a patch by Maksym Veremeyenko verem DOT m1stereo AT tv

Modified:
   trunk/libavcodec/pcm.c

Modified: trunk/libavcodec/pcm.c
==============================================================================
--- trunk/libavcodec/pcm.c	Sun Apr 19 22:25:20 2009	(r18625)
+++ trunk/libavcodec/pcm.c	Sun Apr 19 22:40:56 2009	(r18626)
@@ -361,8 +361,11 @@ static int pcm_decode_frame(AVCodecConte
     n = avctx->channels * sample_size;
 
     if(n && buf_size % n){
+        if (buf_size < n) {
         av_log(avctx, AV_LOG_ERROR, "invalid PCM packet\n");
         return -1;
+        }else
+            buf_size -= buf_size % n;
     }
 
     buf_size= FFMIN(buf_size, *data_size/2);



More information about the ffmpeg-cvslog mailing list