diff options
author | Martin Storsjö <[email protected]> | 2013-09-19 16:57:47 +0300 |
---|---|---|
committer | Luca Barbato <[email protected]> | 2013-10-04 03:26:28 +0200 |
commit | ce1dacb435460dda1f9d453eaaeac44bd502aca4 (patch) | |
tree | 92c6122ed80bf22eb6372a32e732e2476a435603 | |
parent | 78dc022f6f8a8b87773a209e0fcbea2d5b48396f (diff) |
rl2: Avoid a division by zero
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: [email protected]
Signed-off-by: Martin Storsjö <[email protected]>
(cherry picked from commit 3ca14aa5964ea5d11f7a15f9fff17924d6096d44)
Signed-off-by: Luca Barbato <[email protected]>
-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 ac0532f1c9..ab33aabccc 100644 --- a/libavformat/rl2.c +++ b/libavformat/rl2.c @@ -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); |