mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2026-10-28 15:19:38 +03:00
rl2: Avoid a division by zero
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 3ca14aa596)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
This commit is contained in:
committed by
Luca Barbato
parent
78dc022f6f
commit
ce1dacb435
@@ -107,6 +107,10 @@ static av_cold int rl2_read_header(AVFormatContext *s)
|
||||
rate = avio_rl16(pb);
|
||||
channels = avio_rl16(pb);
|
||||
def_sound_size = avio_rl16(pb);
|
||||
if (!channels || channels > 42) {
|
||||
av_log(s, AV_LOG_ERROR, "Invalid number of channels: %d\n", channels);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
/** setup video stream */
|
||||
st = avformat_new_stream(s, NULL);
|
||||
|
||||
Reference in New Issue
Block a user