time -= 2082844800; /* seconds between 1904-01-01 and Epoch */
ptm = gmtime(&time);
if (!ptm) return;
- strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", ptm);
- av_dict_set(metadata, "creation_time", buffer, 0);
+ if (strftime(buffer, sizeof(buffer), "%Y-%m-%d %H:%M:%S", ptm))
+ av_dict_set(metadata, "creation_time", buffer, 0);
}
}
*str = av_mallocz(32);
if (!*str)
return AVERROR(ENOMEM);
- strftime(*str, 32, "%Y-%m-%d %H:%M:%S", &time);
+ if (!strftime(*str, 32, "%Y-%m-%d %H:%M:%S", &time))
+ str[0] = '\0';
return 0;
}
{
time_t t = (value / 10000000LL) - 11644473600LL;
struct tm *tm = gmtime(&t);
- if (tm)
- strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
- else
+ if (tm) {
+ if (!strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm))
+ buf[0] = '\0';
+ } else
buf[0] = '\0';
}
{
time_t t = (value / 10000000LL) - 719162LL*86400LL;
struct tm *tm = gmtime(&t);
- if (tm)
- strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
- else
+ if (tm) {
+ if (!strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm))
+ buf[0] = '\0';
+ } else
buf[0] = '\0';
}
{
time_t t = 631112400LL + 86400*av_int2double(value);
struct tm *tm = gmtime(&t);
- if (tm)
- strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm);
- else
+ if (tm) {
+ if (!strftime(buf, buf_size, "%Y-%m-%d %H:%M:%S", tm))
+ buf[0] = '\0';
+ } else
buf[0] = '\0';
}