update_frame_pool: use channel field
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 11 Mar 2013 16:18:46 +0000 (17:18 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 12 Mar 2013 02:23:51 +0000 (03:23 +0100)
Fix memory corruption

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/utils.c

index d68c280..9085dfe 100644 (file)
@@ -420,7 +420,7 @@ static int update_frame_pool(AVCodecContext *avctx, AVFrame *frame)
         break;
         }
     case AVMEDIA_TYPE_AUDIO: {
         break;
         }
     case AVMEDIA_TYPE_AUDIO: {
-        int ch     = av_get_channel_layout_nb_channels(frame->channel_layout);
+        int ch     = av_frame_get_channels(frame); //av_get_channel_layout_nb_channels(frame->channel_layout);
         int planar = av_sample_fmt_is_planar(frame->format);
         int planes = planar ? ch : 1;
 
         int planar = av_sample_fmt_is_planar(frame->format);
         int planes = planar ? ch : 1;