Do the conversion from double to uint64_t explicitly and only once.
The comparison to UINT64_MAX is not correct.
---
libavformat/matroskadec.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 8a5bc4018a..4ff472005e 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -2328,8 +2328,8 @@ static int matroska_parse_tracks(AVFormatContext *s)
if (track->type == MATROSKA_TRACK_TYPE_VIDEO) {
if (!track->default_duration && track->video.frame_rate > 0) {
- double default_duration = 1000000000 / track->video.frame_rate;
- if (default_duration > UINT64_MAX || default_duration < 0) {
+ uint64_t default_duration = (double)1000000000 /
track->video.frame_rate;
+ if (default_duration > UINT64_MAX) {
av_log(matroska->ctx, AV_LOG_WARNING,
"Invalid frame rate %e. Cannot calculate default
duration.\n",
track->video.frame_rate);
--
2.26.2
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".