mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-11 18:09:36 +00:00
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: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Reviewed-by: Steven Liu <lq@onvideo.cn>
This commit is contained in:
parent
149ee954a3
commit
53c1458bf2
@ -2737,7 +2737,7 @@ static int hls_init(AVFormatContext *s)
|
|||||||
char b[15];
|
char b[15];
|
||||||
struct tm *p, tmbuf;
|
struct tm *p, tmbuf;
|
||||||
if (!(p = localtime_r(&t, &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))
|
if (!strftime(b, sizeof(b), "%Y%m%d%H%M%S", p))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
hls->start_sequence = strtoll(b, NULL, 10);
|
hls->start_sequence = strtoll(b, NULL, 10);
|
||||||
|
Loading…
Reference in New Issue
Block a user