diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-20 14:56:00 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-20 14:58:07 +0200 |
commit | 2a930fa29ea2ae4d613159d3697a4c4d3c47679f (patch) | |
tree | cb1f76269624db9ac3a68a353e37631c8301687d /libavformat/rl2.c | |
parent | 6c18775bae785353dbe25508cab127629f9910a7 (diff) | |
parent | 3ca14aa5964ea5d11f7a15f9fff17924d6096d44 (diff) | |
download | ffmpeg-2a930fa29ea2ae4d613159d3697a4c4d3c47679f.tar.gz |
Merge commit '3ca14aa5964ea5d11f7a15f9fff17924d6096d44'
* commit '3ca14aa5964ea5d11f7a15f9fff17924d6096d44':
rl2: Avoid a division by zero
See: f371396dfb95c116a05e9b9f690fa916bb2d815e
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rl2.c')
-rw-r--r-- | libavformat/rl2.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/rl2.c b/libavformat/rl2.c index 800e12edbe..fb7409eaa6 100644 --- a/libavformat/rl2.c +++ b/libavformat/rl2.c @@ -136,8 +136,10 @@ static av_cold int rl2_read_header(AVFormatContext *s) /** setup audio stream if present */ if(sound_rate){ - if(channels <= 0) + if (!channels || channels > 42) { + av_log(s, AV_LOG_ERROR, "Invalid number of channels: %d\n", channels); return AVERROR_INVALIDDATA; + } pts_num = def_sound_size; pts_den = rate; |