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 commit3ca14aa596
) Signed-off-by: Luca Barbato <lu_zero@gentoo.org> (cherry picked from commitce1dacb435
)
This commit is contained in:

committed by
Luca Barbato

parent
f23b1cc7d9
commit
c211ba9b59
@@ -109,6 +109,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