diff mbox series

[FFmpeg-devel,6/6] avformat/hlsenc: fix av_bprint_finalize() usage

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

Checks

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

Commit Message

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

Don't need to do double check by the description of the API.

Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
---
 libavformat/hlsenc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Nicolas George June 24, 2020, 3:37 p.m. UTC | #1
lance.lmwang@gmail.com (12020-06-22):
> From: Limin Wang <lance.lmwang@gmail.com>
> 
> Don't need to do double check by the description of the API.

Looks ok. Could be simplified even further bu passing s directly.

I do not maintain that file.

Regards,
Limin Wang June 24, 2020, 3:50 p.m. UTC | #2
On Wed, Jun 24, 2020 at 05:37:59PM +0200, Nicolas George wrote:
> lance.lmwang@gmail.com (12020-06-22):
> > From: Limin Wang <lance.lmwang@gmail.com>
> > 
> > Don't need to do double check by the description of the API.
> 
> Looks ok. Could be simplified even further bu passing s directly.

Yes, I prefer to change it in another patch, if you think it's OK
to change in one patch, I'll update the patch.

> 
> I do not maintain that file.
> 
> Regards,
> 
> -- 
>   Nicolas George
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index f7a4f30..a34da2f 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -398,7 +398,7 @@  static int replace_str_data_in_filename(char **s, const char *filename, char pla
         av_bprint_finalize(&buf, NULL);
         return AVERROR(ENOMEM);
     }
-    if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0 || !new_filename)
+    if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0)
         return ret;
     *s = new_filename;
     return found_count;
@@ -448,7 +448,7 @@  static int replace_int_data_in_filename(char **s, const char *filename, char pla
         av_bprint_finalize(&buf, NULL);
         return AVERROR(ENOMEM);
     }
-    if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0 || !new_filename)
+    if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0)
         return ret;
     *s = new_filename;
     return found_count;