Fix rc_eq mem leak.

Originally committed as revision 14788 to svn://svn.ffmpeg.org/ffmpeg/trunk
pull/126/head
Michael Niedermayer 17 years ago
parent 847d05360b
commit 3cffbe090a
  1. 2
      libavcodec/ratecontrol.c
  2. 1
      libavcodec/utils.c
  3. 2
      libavformat/ffmenc.c

@ -106,7 +106,7 @@ int ff_rate_control_init(MpegEncContext *s)
};
emms_c();
rcc->rc_eq_eval = ff_parse(s->avctx->rc_eq, const_names, func1, func1_names, NULL, NULL, &error);
rcc->rc_eq_eval = ff_parse(s->avctx->rc_eq ? s->avctx->rc_eq : "tex^qComp", const_names, func1, func1_names, NULL, NULL, &error);
if (!rcc->rc_eq_eval) {
av_log(s->avctx, AV_LOG_ERROR, "Error parsing rc_eq \"%s\": %s\n", s->avctx->rc_eq, error? error : "");
return -1;

@ -762,7 +762,6 @@ void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType codec_type)
flags= AV_OPT_FLAG_SUBTITLE_PARAM;
av_opt_set_defaults2(s, flags, flags);
s->rc_eq= av_strdup("tex^qComp");
s->time_base= (AVRational){0,1};
s->get_buffer= avcodec_default_get_buffer;
s->release_buffer= avcodec_default_release_buffer;

@ -132,7 +132,7 @@ static int ffm_write_header(AVFormatContext *s)
put_be16(pb, (int) (codec->qcompress * 10000.0));
put_be16(pb, (int) (codec->qblur * 10000.0));
put_be32(pb, codec->bit_rate_tolerance);
put_strz(pb, codec->rc_eq);
put_strz(pb, codec->rc_eq ? codec->rc_eq : "tex^qComp");
put_be32(pb, codec->rc_max_rate);
put_be32(pb, codec->rc_min_rate);
put_be32(pb, codec->rc_buffer_size);

Loading…
Cancel
Save