diff options
author | wm4 <wm4@nowhere> | 2020-03-18 20:44:54 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2020-03-18 20:44:54 +0100 |
commit | a550bf49275a4af232fbbd6a47ba2ce32a9ea98c (patch) | |
tree | 9d70e4dc522b4dabcffa7c2f069ba0864b7c93ac /demux | |
parent | f73db960777cfd285f557e164818e77553a34499 (diff) | |
download | mpv-a550bf49275a4af232fbbd6a47ba2ce32a9ea98c.tar.bz2 mpv-a550bf49275a4af232fbbd6a47ba2ce32a9ea98c.tar.xz |
demux_mkv: fix another integer/float conversion warning
This code could assign INT64_MAX+1 (as double) to int64_t.
Diffstat (limited to 'demux')
-rw-r--r-- | demux/demux_mkv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c index 64cab29c03..bb1125a0f2 100644 --- a/demux/demux_mkv.c +++ b/demux/demux_mkv.c @@ -2995,7 +2995,8 @@ static struct mkv_index *seek_with_cues(struct demuxer *demuxer, int seek_id, double secs = mkv_d->opts->subtitle_preroll_secs; if (mkv_d->index_has_durations) secs = MPMAX(secs, mkv_d->opts->subtitle_preroll_secs_index); - int64_t pre = MPMIN(INT64_MAX, secs * 1e9 / mkv_d->tc_scale); + double pre_f = secs * 1e9 / mkv_d->tc_scale; + int64_t pre = pre_f >= (double)INT64_MAX ? INT64_MAX : (int64_t)pre_f; int64_t min_tc = pre < index->timecode ? index->timecode - pre : 0; uint64_t prev_target = 0; int64_t prev_tc = 0; |