From 3a1a7e32ace7af47de74e8ae779cb4e04c89aa97 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 13 May 2006 10:45:26 +0000 Subject: sanity checks, some might have been exploitable ... Originally committed as revision 5369 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/cook.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavcodec/cook.c') 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) -- cgit v1.2.3