On 09 Mar 2014, at 12:35, Martin Storsjö <[email protected]> wrote:

> From: Hendrik Leppkes <[email protected]>
> 
> The MSVCRT version of strftime calls the invalid parameter handler
> if the struct values in struct tm are invalid. In case no invalid
> parameter handler is set for the process, the process is aborted.
> 
> This fixes fate failures on MSVC builds since 570af382.
> ---
> libavformat/mxfdec.c | 4 ++++
> 1 file changed, 4 insertions(+)
> 
> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> index 27f996f..1276391 100644
> --- a/libavformat/mxfdec.c
> +++ b/libavformat/mxfdec.c
> @@ -1669,6 +1669,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);

Nit: align 0 and 1?

Comment looks almost too obvious, maybe add a few words re: else it will abort 
and we don't want that?

Tim
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to