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>
This commit is contained in:
Andreas Cadhalpun 2016-12-15 02:14:45 +01:00
parent d25769555b
commit 3d673078a0
1 changed files with 3 additions and 0 deletions

View File

@ -20,6 +20,7 @@
*/ */
#include "libavutil/intreadwrite.h" #include "libavutil/intreadwrite.h"
#include "libavcodec/internal.h"
#include "avformat.h" #include "avformat.h"
#include "internal.h" #include "internal.h"
#include "pcm.h" #include "pcm.h"
@ -87,6 +88,8 @@ static int ircam_read_header(AVFormatContext *s)
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
st->codecpar->channels = channels; st->codecpar->channels = channels;
if (st->codecpar->channels > FF_SANE_NB_CHANNELS)
return AVERROR(ENOSYS);
st->codecpar->sample_rate = sample_rate; st->codecpar->sample_rate = sample_rate;
st->codecpar->codec_id = ff_codec_get_id(tags, tag); st->codecpar->codec_id = ff_codec_get_id(tags, tag);