summaryrefslogtreecommitdiff
path: root/libavcodec/alac.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-05-03 21:06:55 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-05-03 21:06:55 +0000
commitf7739f3708f786a0b071d8d8b59331525b0ccfd8 (patch)
treed99a36c997921afb389cc2040eeef54308846189 /libavcodec/alac.c
parent494e353179a138b254630f3a208df3aa639d258f (diff)
Output buffer overflow.
Originally committed as revision 13052 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/alac.c')
-rw-r--r--libavcodec/alac.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/alac.c b/libavcodec/alac.c
index c5a9b767c8..65a74d76e6 100644
--- a/libavcodec/alac.c
+++ b/libavcodec/alac.c
@@ -465,6 +465,11 @@ static int alac_decode_frame(AVCodecContext *avctx,
} else
outputsamples = alac->setinfo_max_samples_per_frame;
+ if(outputsamples > *outputsize / alac->bytespersample){
+ av_log(avctx, AV_LOG_ERROR, "sample buffer too small\n");
+ return -1;
+ }
+
*outputsize = outputsamples * alac->bytespersample;
readsamplesize = alac->setinfo_sample_size - (wasted_bytes * 8) + channels - 1;