diff resample.c @ 8911:28b706b75b00 libavcodec

Prevent heap corruption when resampling 8-bit audio.
author pross
date Sun, 15 Feb 2009 06:29:43 +0000
parents cbeaa8c0fe4f
children fff66291d84d
line wrap: on
line diff
--- a/resample.c	Sun Feb 15 02:36:43 2009 +0000
+++ b/resample.c	Sun Feb 15 06:29:43 2009 +0000
@@ -251,7 +251,7 @@
         int ostride[1] = { 2 };
         const void *ibuf[1] = { input };
         void       *obuf[1];
-        unsigned input_size = nb_samples*s->input_channels*s->sample_size[0];
+        unsigned input_size = nb_samples*s->input_channels*2;
 
         if (!s->buffer_size[0] || s->buffer_size[0] < input_size) {
             av_free(s->buffer[0]);