diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 6bd6c8c944..60d1a5c654 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -682,7 +682,11 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, av_dict_set(&s->metadata, key, str_val, 0); } else if (amf_type == AMF_DATA_TYPE_STRING) { av_dict_set(&s->metadata, key, str_val, 0); - } else if (amf_type == AMF_DATA_TYPE_DATE) { + } else if ( amf_type == AMF_DATA_TYPE_DATE + && isfinite(date.milliseconds) + && date.milliseconds > INT64_MIN/1000 + && date.milliseconds < INT64_MAX/1000 + ) { // timezone is ignored, since there is no easy way to offset the UTC // timestamp into the specified timezone avpriv_dict_set_timestamp(&s->metadata, key, 1000 * (int64_t)date.milliseconds);