Commit 4c63beee authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '8cafeb8b'

* commit '8cafeb8b':
  mxfdec: Validate parameters to strftime

Conflicts:
	libavformat/mxfdec.c

See: 423089e9Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents 53eb4e07 8cafeb8b
......@@ -1704,9 +1704,14 @@ 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);
/* msvcrt versions of strftime calls the invalid parameter handler
* (aborting the process if one isn't set) if the parameters are out
* of range. */
time.tm_mon = av_clip(time.tm_mon, 0, 11);
time.tm_mday = av_clip(time.tm_mday, 1, 31);
time.tm_hour = av_clip(time.tm_hour, 0, 23);
time.tm_min = av_clip(time.tm_min, 0, 59);
time.tm_sec = av_clip(time.tm_sec, 0, 59);
*str = av_mallocz(32);
if (!*str)
......
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