diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-19 16:57:47 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-01-07 09:43:57 +0100 |
commit | c211ba9b59e8a7c730dfacc536e59f036e77950f (patch) | |
tree | 4926c8ced50abc5ee4f1869ebb40fa1cc505bbfd | |
parent | f23b1cc7d979ab0153d203e2e7ecb0ca48e78abb (diff) | |
download | ffmpeg-c211ba9b59e8a7c730dfacc536e59f036e77950f.tar.gz |
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 3ca14aa5964ea5d11f7a15f9fff17924d6096d44)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit ce1dacb435460dda1f9d453eaaeac44bd502aca4)
-rw-r--r-- | libavformat/rl2.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/rl2.c b/libavformat/rl2.c index b2be7c0ca9..b138d7bf46 100644 --- a/libavformat/rl2.c +++ b/libavformat/rl2.c @@ -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); |