Mercurial > libavcodec.hg
comparison cook.c @ 3303:68721b62a528 libavcodec
sanity checks, some might have been exploitable ...
author | michael |
---|---|
date | Sat, 13 May 2006 10:45:26 +0000 |
parents | 9cbd63cca826 |
children | 8e152f15dbf2 |
comparison
equal
deleted
inserted
replaced
3302:cb356bfc7e22 | 3303:68721b62a528 |
---|---|
1251 init_gain_table(q); | 1251 init_gain_table(q); |
1252 | 1252 |
1253 if (init_cook_vlc_tables(q) != 0) | 1253 if (init_cook_vlc_tables(q) != 0) |
1254 return -1; | 1254 return -1; |
1255 | 1255 |
1256 | |
1257 if(avctx->block_align >= UINT_MAX/2) | |
1258 return -1; | |
1259 | |
1256 /* Pad the databuffer with FF_INPUT_BUFFER_PADDING_SIZE, | 1260 /* Pad the databuffer with FF_INPUT_BUFFER_PADDING_SIZE, |
1257 this is for the bitstreamreader. */ | 1261 this is for the bitstreamreader. */ |
1258 if ((q->decoded_bytes_buffer = av_mallocz((avctx->block_align+(4-avctx->block_align%4) + FF_INPUT_BUFFER_PADDING_SIZE)*sizeof(uint8_t))) == NULL) | 1262 if ((q->decoded_bytes_buffer = av_mallocz((avctx->block_align+(4-avctx->block_align%4) + FF_INPUT_BUFFER_PADDING_SIZE)*sizeof(uint8_t))) == NULL) |
1259 return -1; | 1263 return -1; |
1260 | 1264 |