Originally committed as revision 14707 to svn://svn.ffmpeg.org/ffmpeg/trunk
Loren Merritt authored on 2008/08/12 14:59:12... | ... |
@@ -1198,8 +1198,11 @@ static int output_packet(AVInputStream *ist, int ist_index, |
1198 | 1198 |
if (ist->decoding_needed) { |
1199 | 1199 |
switch(ist->st->codec->codec_type) { |
1200 | 1200 |
case CODEC_TYPE_AUDIO:{ |
1201 |
- if(pkt) |
|
1202 |
- samples= av_fast_realloc(samples, &samples_size, FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE)); |
|
1201 |
+ if(pkt && samples_size < FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE)) { |
|
1202 |
+ samples_size = FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE); |
|
1203 |
+ av_free(samples); |
|
1204 |
+ samples= av_malloc(samples_size); |
|
1205 |
+ } |
|
1203 | 1206 |
data_size= samples_size; |
1204 | 1207 |
/* XXX: could avoid copy if PCM 16 bits with same |
1205 | 1208 |
endianness as CPU */ |