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>
This commit is contained in:
@@ -107,6 +107,10 @@ static av_cold int rl2_read_header(AVFormatContext *s)
|
|||||||
rate = avio_rl16(pb);
|
rate = avio_rl16(pb);
|
||||||
channels = avio_rl16(pb);
|
channels = avio_rl16(pb);
|
||||||
def_sound_size = 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 */
|
/** setup video stream */
|
||||||
st = avformat_new_stream(s, NULL);
|
st = avformat_new_stream(s, NULL);
|
||||||
|
Reference in New Issue
Block a user