diff mbox series

[FFmpeg-devel,2/9] avfilter/lavfutils: Fix memleak when avformat_find_stream_info() fails

Message ID 20200910214901.25401-2-andreas.rheinhardt@gmail.com
State Accepted
Commit f38926ec24247d5e7365f0c5e73a5db43146f5a1
Headers show
Series [FFmpeg-devel,1/9] avfilter/lavfutils: Don't use uninitialized pointers for freeing
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Sept. 10, 2020, 9:48 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavfilter/lavfutils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Nicolas George Sept. 11, 2020, 9:14 a.m. UTC | #1
Andreas Rheinhardt (12020-09-10):
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavfilter/lavfutils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

LGTM.

Regards,
Paul B Mahol Sept. 11, 2020, 9:15 a.m. UTC | #2
On Thu, Sep 10, 2020 at 11:48:54PM +0200, Andreas Rheinhardt wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavfilter/lavfutils.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

ok

> diff --git a/libavfilter/lavfutils.c b/libavfilter/lavfutils.c
> index 84dd4c0704..d7de89f4b3 100644
> --- a/libavfilter/lavfutils.c
> +++ b/libavfilter/lavfutils.c
> @@ -46,7 +46,7 @@ int ff_load_image(uint8_t *data[4], int linesize[4],
>  
>      if ((ret = avformat_find_stream_info(format_ctx, NULL)) < 0) {
>          av_log(log_ctx, AV_LOG_ERROR, "Find stream info failed\n");
> -        return ret;
> +        goto end;
>      }
>  
>      par = format_ctx->streams[0]->codecpar;
> -- 
> 2.20.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavfilter/lavfutils.c b/libavfilter/lavfutils.c
index 84dd4c0704..d7de89f4b3 100644
--- a/libavfilter/lavfutils.c
+++ b/libavfilter/lavfutils.c
@@ -46,7 +46,7 @@  int ff_load_image(uint8_t *data[4], int linesize[4],
 
     if ((ret = avformat_find_stream_info(format_ctx, NULL)) < 0) {
         av_log(log_ctx, AV_LOG_ERROR, "Find stream info failed\n");
-        return ret;
+        goto end;
     }
 
     par = format_ctx->streams[0]->codecpar;