diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-12-16 15:46:45 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-12-16 16:59:24 +0100 |
commit | ee181f84a31d5ba3efd28bd635f249cc5240f5a8 (patch) | |
tree | fd9dfd45474ae8daf40b4375d71d0b3ba22fd09b /libavformat | |
parent | 207d9eab5a47c54173a3a3cbe990aa746fe6e39a (diff) | |
download | ffmpeg-ee181f84a31d5ba3efd28bd635f249cc5240f5a8.tar.gz |
lavf: print an error if a packet has been truncated due to filesize
in av_get_packet()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 379ee2b34b..76c4bf7e78 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); |