mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-03-17 20:17:55 +02:00
smacker: Avoid integer overflow when allocating packets
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
8d928023f9
commit
710b0e2702
@ -327,7 +327,7 @@ static int smacker_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||||||
}
|
}
|
||||||
flags >>= 1;
|
flags >>= 1;
|
||||||
}
|
}
|
||||||
if (frame_size < 0)
|
if (frame_size < 0 || frame_size >= INT_MAX/2)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
if (av_new_packet(pkt, frame_size + 769))
|
if (av_new_packet(pkt, frame_size + 769))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user