diff mbox series

[FFmpeg-devel,05/10] fftools/ffmpeg_mux_init: Free pts on error

Message ID 20240427235424.3075968-5-michael@niedermayer.cc
State Accepted
Commit 840f2bc18eddd72fa886aec30efc82991b920c45
Headers show
Series [FFmpeg-devel,01/10] fftools/ffmpeg_enc: simplify opaque_ref check | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Michael Niedermayer April 27, 2024, 11:54 p.m. UTC
Fixes: CID1538863 Resource leak

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 fftools/ffmpeg_mux_init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer June 7, 2024, 7:05 p.m. UTC | #1
On Sun, Apr 28, 2024 at 01:54:19AM +0200, Michael Niedermayer wrote:
> Fixes: CID1538863 Resource leak
> 
> Sponsored-by: Sovereign Tech Fund
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  fftools/ffmpeg_mux_init.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

diff --git a/fftools/ffmpeg_mux_init.c b/fftools/ffmpeg_mux_init.c
index 8797265145c..b1cb6cf7bd7 100644
--- a/fftools/ffmpeg_mux_init.c
+++ b/fftools/ffmpeg_mux_init.c
@@ -3025,7 +3025,7 @@  static int parse_forced_key_frames(void *log, KeyframeForceCtx *kf,
             if (nb_ch > INT_MAX - size ||
                 !(pts = av_realloc_f(pts, size += nb_ch - 1,
                                      sizeof(*pts))))
-                return AVERROR(ENOMEM);
+                goto fail;
 
             if (p[8]) {
                 ret = av_parse_time(&t, p + 8, 1);