diff mbox

[FFmpeg-devel,7/9] pvfdec: prevent overflow during block alignment calculation

Message ID 34d563ef-f1b5-810a-6348-e99535a1a804@googlemail.com
State Accepted
Headers show

Commit Message

Andreas Cadhalpun Jan. 6, 2017, 7:49 p.m. UTC
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
---
 libavformat/pvfdec.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/libavformat/pvfdec.c b/libavformat/pvfdec.c
index b9f6d4f2c2..94ef20c249 100644
--- a/libavformat/pvfdec.c
+++ b/libavformat/pvfdec.c
@@ -56,6 +56,7 @@  static int pvf_read_header(AVFormatContext *s)
     st->codecpar->sample_rate = sample_rate;
     st->codecpar->codec_id    = ff_get_pcm_codec_id(bps, 0, 1, 0xFFFF);
     st->codecpar->bits_per_coded_sample = bps;
+    FF_RETURN_ON_OVERFLOW(s, bps > INT_MAX / st->codecpar->channels)
     st->codecpar->block_align = bps * st->codecpar->channels / 8;
 
     avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);