summaryrefslogtreecommitdiff
path: root/libavcodec/cook.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-05-13 10:45:26 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-05-13 10:45:26 +0000
commit3a1a7e32ace7af47de74e8ae779cb4e04c89aa97 (patch)
tree54f9925f5f74bf9ca24ede510f6deffd98f2e2c6 /libavcodec/cook.c
parentce1d2a95c3d73663aecc6e5f51533d2bcf1fb1ae (diff)
sanity checks, some might have been exploitable ...
Originally committed as revision 5369 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/cook.c')
-rw-r--r--libavcodec/cook.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c
index 07368ca476..fb04cf574e 100644
--- a/libavcodec/cook.c
+++ b/libavcodec/cook.c
@@ -1253,6 +1253,10 @@ static int cook_decode_init(AVCodecContext *avctx)
if (init_cook_vlc_tables(q) != 0)
return -1;
+
+ if(avctx->block_align >= UINT_MAX/2)
+ return -1;
+
/* Pad the databuffer with FF_INPUT_BUFFER_PADDING_SIZE,
this is for the bitstreamreader. */
if ((q->decoded_bytes_buffer = av_mallocz((avctx->block_align+(4-avctx->block_align%4) + FF_INPUT_BUFFER_PADDING_SIZE)*sizeof(uint8_t))) == NULL)