diff alac.c @ 6744:cb04861f9e45 libavcodec

Output buffer overflow.
author michael
date Sat, 03 May 2008 21:06:55 +0000
parents 25c5f3b5e902
children ec58e76c25a3
line wrap: on
line diff
--- a/alac.c	Sat May 03 21:01:47 2008 +0000
+++ b/alac.c	Sat May 03 21:06:55 2008 +0000
@@ -465,6 +465,11 @@
     } 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;