]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/ratecontrol.c
avcodec/jpeg2000dwt: assert that mod == 0 for encoding
[ffmpeg] / libavcodec / ratecontrol.c
index 4eb363013ce75fffcb87a3202620a432fcefa32c..c6a51a248616dbb63ac0d5e551f2df44b192249b 100644 (file)
@@ -223,8 +223,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->avctx->flags & CODEC_FLAG_PASS2) && s->avctx->rc_strategy == FF_RC_STRATEGY_XVID) {