vlc | branch: master | Tobias Güntner <[email protected]> | Thu Mar 29 23:09:05 2012 +0200| [c34b980c06855220903643f3a33cd9465560f570] | committer: Rémi Denis-Courmont
Improve range check. Use >= instead of > in range check because INT64_MAX could be rounded up when converted to a double for comparison. Signed-off-by: Rémi Denis-Courmont <[email protected]> > http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c34b980c06855220903643f3a33cd9465560f570 --- modules/demux/live555.cpp | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/modules/demux/live555.cpp b/modules/demux/live555.cpp index 645b176..93433a7 100644 --- a/modules/demux/live555.cpp +++ b/modules/demux/live555.cpp @@ -1357,8 +1357,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args ) if( p_sys->f_npt_length > 0 ) { double d_length = p_sys->f_npt_length * 1000000.0; - /* Not sure if -0.5 is needed, but better be safe */ - if( d_length - 0.5 > INT64_MAX ) + if( d_length >= INT64_MAX ) *pi64 = INT64_MAX; else *pi64 = (int64_t)d_length; _______________________________________________ vlc-commits mailing list [email protected] http://mailman.videolan.org/listinfo/vlc-commits
