Revision 81b060fa ffmpeg.c

View differences:

ffmpeg.c
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 */

Also available in: Unified diff