[FFmpeg-cvslog] r14905 - trunk/libavcodec/alac.c
jai_menon
subversion
Fri Aug 22 17:09:20 CEST 2008
Author: jai_menon
Date: Fri Aug 22 17:09:20 2008
New Revision: 14905
Log:
alac : check readsamplesize to ensure get_bits() doesn't
fail. Patch by Matthieu Castet <castet.matthieu AT free fr>
Modified:
trunk/libavcodec/alac.c
Modified: trunk/libavcodec/alac.c
==============================================================================
--- trunk/libavcodec/alac.c (original)
+++ trunk/libavcodec/alac.c Fri Aug 22 17:09:20 2008
@@ -411,7 +411,7 @@ static int alac_decode_frame(AVCodecCont
int channels;
unsigned int outputsamples;
int hassize;
- int readsamplesize;
+ unsigned int readsamplesize;
int wasted_bytes;
int isnotcompressed;
uint8_t interlacing_shift;
@@ -476,6 +476,10 @@ static int alac_decode_frame(AVCodecCont
*outputsize = outputsamples * alac->bytespersample;
readsamplesize = alac->setinfo_sample_size - (wasted_bytes * 8) + channels - 1;
+ if (readsamplesize > MIN_CACHE_BITS) {
+ av_log(avctx, AV_LOG_ERROR, "readsamplesize too big (%d)\n", readsamplesize);
+ return -1;
+ }
if (!isnotcompressed) {
/* so it is compressed */
More information about the ffmpeg-cvslog
mailing list