diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index d5899393bb..c53849a769 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1379,6 +1379,8 @@ static int mxf_parse_mpeg2_frame(AVFormatContext *s, AVStream *st, static uint64_t mxf_parse_timestamp(time_t timestamp) { struct tm *time = gmtime(×tamp); + if (!time) + return 0; return (uint64_t)(time->tm_year+1900) << 48 | (uint64_t)(time->tm_mon+1) << 40 | (uint64_t) time->tm_mday << 32 |