Commit 423089e9 authored by Hendrik Leppkes's avatar Hendrik Leppkes Committed by Michael Niedermayer

lavf/mxfdec: validate month/day before date formatting

Some implementations of strftime do not like invalid values for
month/day, so ensure it doesn't happen.
Reviewed-by: 's avatarMatthieu Bouron <matthieu.bouron@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c8b36444
......@@ -1668,6 +1668,10 @@ static int mxf_timestamp_to_str(uint64_t timestamp, char **str)
time.tm_min = (timestamp >> 16 & 0xFF);
time.tm_sec = (timestamp >> 8 & 0xFF);
/* ensure month/day are valid */
time.tm_mon = FFMAX(time.tm_mon, 0);
time.tm_mday = FFMAX(time.tm_mday, 1);
*str = av_mallocz(32);
if (!*str)
return AVERROR(ENOMEM);
......
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