diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2006-05-13 10:45:26 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2006-05-13 10:45:26 +0000 |
commit | 3a1a7e32ace7af47de74e8ae779cb4e04c89aa97 (patch) | |
tree | 54f9925f5f74bf9ca24ede510f6deffd98f2e2c6 /libavcodec/cook.c | |
parent | ce1d2a95c3d73663aecc6e5f51533d2bcf1fb1ae (diff) | |
download | ffmpeg-streaming-3a1a7e32ace7af47de74e8ae779cb4e04c89aa97.zip ffmpeg-streaming-3a1a7e32ace7af47de74e8ae779cb4e04c89aa97.tar.gz |
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.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 07368ca..fb04cf5 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) |