Commit 53c1458b authored by Andreas Rheinhardt's avatar Andreas Rheinhardt Committed by Steven Liu

avformat/hlsenc: Fix return value from localtime_r failure

"If an error is detected, localtime_r() shall return a null pointer
and set errno to indicate the error." Yet in case this happened in
hls_init(), AVERROR(ENOMEM) has been returned.
Signed-off-by: 's avatarAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: 's avatarSteven Liu <lq@onvideo.cn>
parent 149ee954
......@@ -2737,7 +2737,7 @@ static int hls_init(AVFormatContext *s)
char b[15];
struct tm *p, tmbuf;
if (!(p = localtime_r(&t, &tmbuf)))
return AVERROR(ENOMEM);
return AVERROR(errno);
if (!strftime(b, sizeof(b), "%Y%m%d%H%M%S", p))
return AVERROR(ENOMEM);
hls->start_sequence = strtoll(b, NULL, 10);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment