aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2020-06-22 21:58:47 +0800
committerLimin Wang <lance.lmwang@gmail.com>2020-07-02 21:12:37 +0800
commitdb92efd83e6128ebc301ce615eda137c132ac290 (patch)
tree7e70d19a11bcbe3df98ee724d9f5fe205923d912 /libavformat/hlsenc.c
parent64059f5063ab37828b4082c7acafe4b82c532587 (diff)
downloadffmpeg-db92efd83e6128ebc301ce615eda137c132ac290.tar.gz
avformat/hlsenc: use proper error codes
Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 71fa3db060..f7a4f30c47 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -370,6 +370,7 @@ static int replace_str_data_in_filename(char **s, const char *filename, char pla
int addchar_count;
int found_count = 0;
AVBPrint buf;
+ int ret;
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
@@ -395,10 +396,10 @@ static int replace_str_data_in_filename(char **s, const char *filename, char pla
}
if (!av_bprint_is_complete(&buf)) {
av_bprint_finalize(&buf, NULL);
- return -1;
+ return AVERROR(ENOMEM);
}
- if (av_bprint_finalize(&buf, &new_filename) < 0 || !new_filename)
- return -1;
+ if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0 || !new_filename)
+ return ret;
*s = new_filename;
return found_count;
}
@@ -411,6 +412,7 @@ static int replace_int_data_in_filename(char **s, const char *filename, char pla
int nd, addchar_count;
int found_count = 0;
AVBPrint buf;
+ int ret;
av_bprint_init(&buf, 0, AV_BPRINT_SIZE_UNLIMITED);
@@ -444,10 +446,10 @@ static int replace_int_data_in_filename(char **s, const char *filename, char pla
}
if (!av_bprint_is_complete(&buf)) {
av_bprint_finalize(&buf, NULL);
- return -1;
+ return AVERROR(ENOMEM);
}
- if (av_bprint_finalize(&buf, &new_filename) < 0 || !new_filename)
- return -1;
+ if ((ret = av_bprint_finalize(&buf, &new_filename)) < 0 || !new_filename)
+ return ret;
*s = new_filename;
return found_count;
}