From 549bccdbe43b97f19d276078e6c742549d616aad Mon Sep 17 00:00:00 2001
From: Justin Ruggles <justin.ruggles@gmail.com>
Date: Wed, 4 Mar 2009 23:16:30 +0000
Subject: [PATCH] flacdec: Handle 32 bps data when checking allocated size.

Originally committed as revision 17814 to svn://svn.ffmpeg.org/ffmpeg/trunk
---
 libavcodec/flacdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c
index 73e524a55de..ab2be93442d 100644
--- a/libavcodec/flacdec.c
+++ b/libavcodec/flacdec.c
@@ -545,7 +545,7 @@ static int decode_frame(FLACContext *s, int alloc_data_size)
         return -1;
     }
 
-    if (blocksize * s->channels * sizeof(int16_t) > alloc_data_size)
+    if (blocksize * s->channels * (s->is32 ? 4 : 2) > alloc_data_size)
         return -1;
 
     if (sample_rate_code == 0)
-- 
GitLab