mirror of
https://github.com/xenia-project/FFmpeg.git
synced 2024-11-24 12:09:55 +00:00
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>
This commit is contained in:
parent
207d9eab5a
commit
ee181f84a3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user