---
On top of 13/17.
Vittorio
libavcodec/ratecontrol.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index 6fe174a..eafe97d 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -212,8 +212,10 @@ av_cold int ff_rate_control_init(MpegEncContext *s)
p = next;
}
- if (init_pass2(s) < 0)
+ if (init_pass2(s) < 0) {
+ ff_rate_control_uninit(s);
return -1;
+ }
// FIXME maybe move to end
if ((s->flags & CODEC_FLAG_PASS2) && s->avctx->rc_strategy ==
FF_RC_STRATEGY_XVID) {
@@ -935,8 +937,8 @@ static int init_pass2(MpegEncContext *s)
qscale = av_malloc(sizeof(double) * rcc->num_entries);
blurred_qscale = av_malloc(sizeof(double) * rcc->num_entries);
if (!qscale || !blurred_qscale) {
- av_freep(&qscale);
- av_freep(&blurred_qscale);
+ av_free(qscale);
+ av_free(blurred_qscale);
return AVERROR(ENOMEM);
}
toobig = 0;
--
1.9.5 (Apple Git-50.3)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel