[FFmpeg-cvslog] lavf: print an error if a packet has been truncated due to filesize

Michael Niedermayer git at videolan.org
Fri Dec 16 17:18:18 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Dec 16 15:46:45 2011 +0100| [ee181f84a31d5ba3efd28bd635f249cc5240f5a8] | committer: Michael Niedermayer

lavf: print an error if a packet has been truncated due to filesize
in av_get_packet()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ee181f84a31d5ba3efd28bd635f249cc5240f5a8
---

 libavformat/utils.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 379ee2b..76c4bf7 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -278,8 +278,10 @@ int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
             remaining= s->maxsize - avio_tell(s);
         }
 
-        if(s->maxsize>=0 && remaining>=0)
-            size= FFMIN(size, remaining+1);
+        if(s->maxsize>=0 && remaining>=0 && remaining+1 < size){
+            av_log(0, AV_LOG_ERROR, "Truncating packet of size %d to %"PRId64"\n", size, remaining+1);
+            size= remaining+1;
+        }
     }
 
     ret= av_new_packet(pkt, size);



More information about the ffmpeg-cvslog mailing list