Merge commit 'a78f5548d94f23ce23cece41edf0fe9d18926de6'
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 23 Apr 2015 19:31:06 +0000 (21:31 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 23 Apr 2015 19:41:23 +0000 (21:41 +0200)
* commit 'a78f5548d94f23ce23cece41edf0fe9d18926de6':
  avcodec: Free the default avoptions on init failure

See: 1907ff0a67edeb98d9153aac79f35961837ba3f6
Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
libavcodec/utils.c

@@@ -1709,9 -1292,11 +1709,11 @@@ free_and_end
          (avctx->codec->caps_internal & FF_CODEC_CAP_INIT_CLEANUP))
          avctx->codec->close(avctx);
  
-     av_dict_free(&tmp);
 -    if (avctx->priv_data && avctx->codec && avctx->codec->priv_class)
 +    if (codec->priv_class && codec->priv_data_size)
          av_opt_free(avctx->priv_data);
+     av_opt_free(avctx);
+     av_dict_free(&tmp);
      av_freep(&avctx->priv_data);
      if (avctx->internal) {
          av_frame_free(&avctx->internal->to_free);