Commit 99779c95 authored by pross's avatar pross

Prevent heap corruption when resampling 8-bit audio.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@17311 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 5a2ffd8b
...@@ -251,7 +251,7 @@ int audio_resample(ReSampleContext *s, short *output, short *input, int nb_sampl ...@@ -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]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment