[FFmpeg-cvslog] avconv: Use the size of the decode sample format when allocating the audio samples buffer .

Alex Converse git at videolan.org
Thu Sep 29 01:19:10 CEST 2011


ffmpeg | branch: master | Alex Converse <alex.converse at gmail.com> | Tue Sep 27 10:20:23 2011 -0700| [af3c06b4dbe3bdc801d3fdc3392e7f47b414c17c] | committer: Alex Converse

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

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=af3c06b4dbe3bdc801d3fdc3392e7f47b414c17c
---

 avconv.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/avconv.c b/avconv.c
index ed5d709..ad5547f 100644
--- a/avconv.c
+++ b/avconv.c
@@ -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);
                 }



More information about the ffmpeg-cvslog mailing list