Browse Source

avconv: Use the size of the decode sample format when allocating the audio samples buffer.

tags/n0.9
Alex Converse 13 years ago
parent
commit
af3c06b4db
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      avconv.c

+ 2
- 2
avconv.c View File

@@ -1573,8 +1573,8 @@ static int output_packet(InputStream *ist, int ist_index,
if (ist->decoding_needed) {
switch(ist->st->codec->codec_type) {
case AVMEDIA_TYPE_AUDIO:{
if(pkt && samples_size < FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE)) {
samples_size = FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE);
if(pkt && samples_size < FFMAX(pkt->size * bps, AVCODEC_MAX_AUDIO_FRAME_SIZE)) {
samples_size = FFMAX(pkt->size * bps, AVCODEC_MAX_AUDIO_FRAME_SIZE);
av_free(samples);
samples= av_malloc(samples_size);
}


Loading…
Cancel
Save