diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2017-12-04 12:05:04 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2017-12-04 12:05:04 +0800 |
commit | ad6946b8189e5e17796f1d5bf86d97ee619009b8 (patch) | |
tree | 07c15a7ff111a4b849b997ff585ca43f83630a9c /libavformat/hlsplaylist.c | |
parent | 071f47649ce39897f18ce034dd428067f29d9b66 (diff) | |
download | ffmpeg-streaming-ad6946b8189e5e17796f1d5bf86d97ee619009b8.zip ffmpeg-streaming-ad6946b8189e5e17796f1d5bf86d97ee619009b8.tar.gz |
avformat/hlsplaylist: add return value check of strftime
fix CID: 1424884
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat/hlsplaylist.c')
-rw-r--r-- | libavformat/hlsplaylist.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/hlsplaylist.c b/libavformat/hlsplaylist.c index 96a8afb..3349eb7 100644 --- a/libavformat/hlsplaylist.c +++ b/libavformat/hlsplaylist.c @@ -109,7 +109,10 @@ int ff_hls_write_file_entry(AVIOContext *out, int insert_discont, tt = (int64_t)*prog_date_time; milli = av_clip(lrint(1000*(*prog_date_time - tt)), 0, 999); tm = localtime_r(&tt, &tmpbuf); - strftime(buf0, sizeof(buf0), "%Y-%m-%dT%H:%M:%S", tm); + if (!strftime(buf0, sizeof(buf0), "%Y-%m-%dT%H:%M:%S", tm)) { + av_log(NULL, AV_LOG_DEBUG, "strftime error in ff_hls_write_file_entry\n"); + return AVERROR_UNKNOWN; + } if (!strftime(buf1, sizeof(buf1), "%z", tm) || buf1[1]<'0' ||buf1[1]>'2') { int tz_min, dst = tm->tm_isdst; tm = gmtime_r(&tt, &tmpbuf); |