aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-16 15:46:45 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-16 16:59:24 +0100
commitee181f84a31d5ba3efd28bd635f249cc5240f5a8 (patch)
treefd9dfd45474ae8daf40b4375d71d0b3ba22fd09b /libavformat
parent207d9eab5a47c54173a3a3cbe990aa746fe6e39a (diff)
downloadffmpeg-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.c6
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);