diff mbox

[FFmpeg-devel,6/7] nistspheredec: prevent overflow during block alignment calculation

Message ID 4bfe4cbe-2762-61bc-9b2e-0e5e2fc7eb00@googlemail.com
State Superseded
Headers show

Commit Message

Andreas Cadhalpun Dec. 16, 2016, 2:34 a.m. UTC
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
---
 libavformat/nistspheredec.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox

Patch

diff --git a/libavformat/nistspheredec.c b/libavformat/nistspheredec.c
index 782d1df..b5ebcb8 100644
--- a/libavformat/nistspheredec.c
+++ b/libavformat/nistspheredec.c
@@ -80,6 +80,7 @@  static int nist_read_header(AVFormatContext *s)
 
             avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate);
 
+            FF_BAIL_ON_OVERFLOW(s, st->codecpar->channels && st->codecpar->bits_per_coded_sample > INT_MAX / st->codecpar->channels)
             st->codecpar->block_align = st->codecpar->bits_per_coded_sample * st->codecpar->channels / 8;
 
             if (avio_tell(s->pb) > header_size)