Browse Source

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>
tags/n2.1
Martin Storsjö 12 years ago
parent
commit
3ca14aa596
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/rl2.c

+ 4
- 0
libavformat/rl2.c View File

@@ -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);


Loading…
Cancel
Save