summaryrefslogtreecommitdiff
path: root/libavformat/ircamdec.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2016-12-15 02:14:45 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2017-01-31 02:11:17 +0100
commit3d673078a03a3819df9dba7667f9e5d59b8487d0 (patch)
treea88b492e0e82be62635998069b04d67e2a64d5dc /libavformat/ircamdec.c
parentd25769555bb3e73c811da05d309856883ff41a9f (diff)
ircamdec: prevent overflow during block alignment calculation
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/ircamdec.c')
-rw-r--r--libavformat/ircamdec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/ircamdec.c b/libavformat/ircamdec.c
index 59f3a49411..a6b7a280f3 100644
--- a/libavformat/ircamdec.c
+++ b/libavformat/ircamdec.c
@@ -20,6 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
+#include "libavcodec/internal.h"
#include "avformat.h"
#include "internal.h"
#include "pcm.h"
@@ -87,6 +88,8 @@ static int ircam_read_header(AVFormatContext *s)
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->channels = channels;
+ if (st->codecpar->channels > FF_SANE_NB_CHANNELS)
+ return AVERROR(ENOSYS);
st->codecpar->sample_rate = sample_rate;
st->codecpar->codec_id = ff_codec_get_id(tags, tag);