[FFmpeg-devel,2/6] electronicarts: prevent overflow during block alignment, calculation

Submitted by Andreas Cadhalpun on Dec. 15, 2016, 1:18 a.m.

Details

Message ID 18dc26b9-4a7b-8d4f-556f-abad75f6fd5f@googlemail.com
State New
Headers show

Commit Message

Andreas Cadhalpun Dec. 15, 2016, 1:18 a.m.
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
---
 libavformat/electronicarts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 30eb723..35a7363 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -539,7 +539,7 @@  static int ea_read_header(AVFormatContext *s)
             ea->audio_codec = 0;
             return 1;
         }
-        if (ea->bytes <= 0) {
+        if (ea->bytes <= 0 || ea->bytes > INT_MAX / 8 / 2) {
             av_log(s, AV_LOG_ERROR,
                    "Invalid number of bytes per sample: %d\n", ea->bytes);
             ea->audio_codec = AV_CODEC_ID_NONE;