Commit ee181f84 authored by Michael Niedermayer's avatar Michael Niedermayer

lavf: print an error if a packet has been truncated due to filesize

in av_get_packet()
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 207d9eab
...@@ -278,8 +278,10 @@ int av_get_packet(AVIOContext *s, AVPacket *pkt, int size) ...@@ -278,8 +278,10 @@ int av_get_packet(AVIOContext *s, AVPacket *pkt, int size)
remaining= s->maxsize - avio_tell(s); remaining= s->maxsize - avio_tell(s);
} }
if(s->maxsize>=0 && remaining>=0) if(s->maxsize>=0 && remaining>=0 && remaining+1 < size){
size= FFMIN(size, remaining+1); 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); ret= av_new_packet(pkt, size);
......
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