Avoid a null pointer dereference on clean-up after oom in ac3 encoder.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 29 Jun 2013 15:50:07 +0000 (17:50 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Sat, 29 Jun 2013 15:50:07 +0000 (17:50 +0200)
libavcodec/ac3enc.c

index a0b810e..37c496c 100644 (file)
@@ -2017,6 +2017,7 @@ av_cold int ff_ac3_encode_close(AVCodecContext *avctx)
     AC3EncodeContext *s = avctx->priv_data;
 
     av_freep(&s->windowed_samples);
+    if (s->planar_samples)
     for (ch = 0; ch < s->channels; ch++)
         av_freep(&s->planar_samples[ch]);
     av_freep(&s->planar_samples);