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

lance.lmwang at gmail.com lance.lmwang at gmail.com
Mon Jun 22 18:24:34 EEST 2020


From: Limin Wang <lance.lmwang at gmail.com>

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

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

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;
-- 
1.8.3.1



More information about the ffmpeg-devel mailing list