mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
asfdec: fix assert failure on invalid files
Add an extra size validity check in asf_read_frame_header(). Without this asf->packet_size_left may become negative, which triggers an assertion failure later.
This commit is contained in:
parent
10291562f3
commit
bcedf2e519
@ -842,6 +842,10 @@ static int asf_read_frame_header(AVFormatContext *s, AVIOContext *pb){
|
|||||||
av_log(s, AV_LOG_ERROR, "unexpected packet_replic_size of %d\n", asf->packet_replic_size);
|
av_log(s, AV_LOG_ERROR, "unexpected packet_replic_size of %d\n", asf->packet_replic_size);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
if (rsize > asf->packet_size_left) {
|
||||||
|
av_log(s, AV_LOG_ERROR, "packet_replic_size is invalid\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
if (asf->packet_flags & 0x01) {
|
if (asf->packet_flags & 0x01) {
|
||||||
DO_2BITS(asf->packet_segsizetype >> 6, asf->packet_frag_size, 0); // 0 is illegal
|
DO_2BITS(asf->packet_segsizetype >> 6, asf->packet_frag_size, 0); // 0 is illegal
|
||||||
if(asf->packet_frag_size > asf->packet_size_left - rsize){
|
if(asf->packet_frag_size > asf->packet_size_left - rsize){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user