[vlc-commits] es_format: Avoid potential integer overflow

Hugo Beauzée-Luyssen git at videolan.org
Thu Aug 24 16:25:39 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Thu Aug 24 15:31:08 2017 +0200| [cd05e3209ffabc4a012ba6524cba62cd669a98ec] | committer: Hugo Beauzée-Luyssen

es_format: Avoid potential integer overflow

As it's already done when comparing video formats in decoder.c's vout_update_format

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=cd05e3209ffabc4a012ba6524cba62cd669a98ec
---

 src/misc/es_format.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/misc/es_format.c b/src/misc/es_format.c
index ccf6d5c46b..86f29c4375 100644
--- a/src/misc/es_format.c
+++ b/src/misc/es_format.c
@@ -392,7 +392,8 @@ bool video_format_IsSimilar( const video_format_t *f1,
         f1->i_visible_height != f2->i_visible_height ||
         f1->i_x_offset != f2->i_x_offset || f1->i_y_offset != f2->i_y_offset )
         return false;
-    if( f1->i_sar_num * f2->i_sar_den != f2->i_sar_num * f1->i_sar_den )
+    if( (int64_t)f1->i_sar_num * f2->i_sar_den !=
+        (int64_t)f2->i_sar_num * f1->i_sar_den )
         return false;
 
     if( f1->orientation != f2->orientation)



More information about the vlc-commits mailing list