diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2016-12-15 02:14:31 +0100 |
---|---|---|
committer | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2017-01-29 01:20:48 +0100 |
commit | e3f13d3a87274d537d319a84e9104f44f84ec3b2 (patch) | |
tree | 92632534cad8961192f2c2d313c2d867e6955bee /libavformat/4xm.c | |
parent | 227d602bb36f9460e007fb3e1fbff4a776838498 (diff) | |
download | ffmpeg-e3f13d3a87274d537d319a84e9104f44f84ec3b2.tar.gz |
4xm: prevent overflow during block alignment calculation
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavformat/4xm.c')
-rw-r--r-- | libavformat/4xm.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c index 2758b69d29..ead6d2b424 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -29,6 +29,7 @@ #include "libavutil/intreadwrite.h" #include "libavutil/intfloat.h" +#include "libavcodec/internal.h" #include "avformat.h" #include "internal.h" @@ -153,8 +154,10 @@ static int parse_strk(AVFormatContext *s, fourxm->tracks[track].audio_pts = 0; if (fourxm->tracks[track].channels <= 0 || + fourxm->tracks[track].channels > FF_SANE_NB_CHANNELS || fourxm->tracks[track].sample_rate <= 0 || - fourxm->tracks[track].bits <= 0) { + fourxm->tracks[track].bits <= 0 || + fourxm->tracks[track].bits > INT_MAX / FF_SANE_NB_CHANNELS) { av_log(s, AV_LOG_ERROR, "audio header invalid\n"); return AVERROR_INVALIDDATA; } |