1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

Prevent heap corruption when resampling 8-bit audio.

Originally committed as revision 17311 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Peter Ross 2009-02-15 06:29:43 +00:00
parent a0723a4d84
commit 5f5e6af169

View File

@ -251,7 +251,7 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl
int ostride[1] = { 2 }; int ostride[1] = { 2 };
const void *ibuf[1] = { input }; const void *ibuf[1] = { input };
void *obuf[1]; 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) { if (!s->buffer_size[0] || s->buffer_size[0] < input_size) {
av_free(s->buffer[0]); av_free(s->buffer[0]);