diff mbox series

[FFmpeg-devel,1/6] avutil/opt: check return value of av_bprint_finalize()

Message ID 1592839474-2804-1-git-send-email-lance.lmwang@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,1/6] avutil/opt: check return value of av_bprint_finalize() | expand

Checks

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

Commit Message

Lance Wang June 22, 2020, 3:24 p.m. UTC
From: Limin Wang <lance.lmwang@gmail.com>

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavutil/opt.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Tim Bradstock June 24, 2020, 2:08 p.m. UTC | #1
unsubscribe

On Mon, Jun 22, 2020 at 4:32 PM <lance.lmwang@gmail.com> wrote:

> From: Limin Wang <lance.lmwang@gmail.com>
>
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavutil/opt.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/libavutil/opt.c b/libavutil/opt.c
> index 2c3f998..552985e 100644
> --- a/libavutil/opt.c
> +++ b/libavutil/opt.c
> @@ -2120,6 +2120,9 @@ int av_opt_serialize(void *obj, int opt_flags, int
> flags, char **buffer,
>              av_freep(&buf);
>          }
>      }
> -    av_bprint_finalize(&bprint, buffer);
> +    ret = av_bprint_finalize(&bprint, buffer);
> +    if (ret < 0)
> +        return ret;
> +
>      return 0;
>  }
> --
> 1.8.3.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".
Nicolas George June 24, 2020, 3:36 p.m. UTC | #2
lance.lmwang@gmail.com (12020-06-22):
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> ---
>  libavutil/opt.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/libavutil/opt.c b/libavutil/opt.c
> index 2c3f998..552985e 100644
> --- a/libavutil/opt.c
> +++ b/libavutil/opt.c
> @@ -2120,6 +2120,9 @@ int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer,
>              av_freep(&buf);
>          }
>      }
> -    av_bprint_finalize(&bprint, buffer);
> +    ret = av_bprint_finalize(&bprint, buffer);
> +    if (ret < 0)
> +        return ret;
> +
>      return 0;
>  }

The extra empty line seems unnecessary. LGTM otherwise.

Regards,
Lance Wang June 24, 2020, 3:46 p.m. UTC | #3
On Wed, Jun 24, 2020 at 05:36:08PM +0200, Nicolas George wrote:
> lance.lmwang@gmail.com (12020-06-22):
> > From: Limin Wang <lance.lmwang@gmail.com>
> > 
> > Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
> > ---
> >  libavutil/opt.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/libavutil/opt.c b/libavutil/opt.c
> > index 2c3f998..552985e 100644
> > --- a/libavutil/opt.c
> > +++ b/libavutil/opt.c
> > @@ -2120,6 +2120,9 @@ int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer,
> >              av_freep(&buf);
> >          }
> >      }
> > -    av_bprint_finalize(&bprint, buffer);
> > +    ret = av_bprint_finalize(&bprint, buffer);
> > +    if (ret < 0)
> > +        return ret;
> > +
> >      return 0;
> >  }
> 
> The extra empty line seems unnecessary. LGTM otherwise.

Thanks, fix locally. will apply tomorrow if no comments from other developer.

> 
> Regards,
> 
> -- 
>   Nicolas George
diff mbox series

Patch

diff --git a/libavutil/opt.c b/libavutil/opt.c
index 2c3f998..552985e 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -2120,6 +2120,9 @@  int av_opt_serialize(void *obj, int opt_flags, int flags, char **buffer,
             av_freep(&buf);
         }
     }
-    av_bprint_finalize(&bprint, buffer);
+    ret = av_bprint_finalize(&bprint, buffer);
+    if (ret < 0)
+        return ret;
+
     return 0;
 }