diff mbox series

[FFmpeg-devel,v2,01/71] avcodec/ratecontrol: Fix double free on error

Message ID AS8P250MB074471DDEA29072B2586F0EF8FE02@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel,v2,01/71] avcodec/ratecontrol: Fix double free on error | expand

Commit Message

Andreas Rheinhardt May 11, 2024, 8:23 p.m. UTC
Happens on init_pass2() failure.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/ratecontrol.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Andreas Rheinhardt June 11, 2024, 8:59 p.m. UTC | #1
Andreas Rheinhardt:
> Happens on init_pass2() failure.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavcodec/ratecontrol.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
> index 9ee08ecb88..27017d7976 100644
> --- a/libavcodec/ratecontrol.c
> +++ b/libavcodec/ratecontrol.c
> @@ -694,6 +694,7 @@ av_cold void ff_rate_control_uninit(MpegEncContext *s)
>      emms_c();
>  
>      av_expr_free(rcc->rc_eq_eval);
> +    rcc->rc_eq_eval = NULL;
>      av_freep(&rcc->entry);
>  }
>  

Will apply this patchset tomorrow unless there are objections.

- Andreas
diff mbox series

Patch

diff --git a/libavcodec/ratecontrol.c b/libavcodec/ratecontrol.c
index 9ee08ecb88..27017d7976 100644
--- a/libavcodec/ratecontrol.c
+++ b/libavcodec/ratecontrol.c
@@ -694,6 +694,7 @@  av_cold void ff_rate_control_uninit(MpegEncContext *s)
     emms_c();
 
     av_expr_free(rcc->rc_eq_eval);
+    rcc->rc_eq_eval = NULL;
     av_freep(&rcc->entry);
 }