[vlc-commits] mp4: fix integer underflow

Rémi Denis-Courmont git at videolan.org
Sat Jun 29 14:46:17 CEST 2019


vlc/vlc-3.0 | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Jun 27 23:19:38 2019 +0300| [05eb4441af9ce9c241c9a7683d57df3d7b9dd689] | committer: Rémi Denis-Courmont

mp4: fix integer underflow

Reported-by: Hyeon-Ju Lee <zorurione at gmail.com>
(cherry picked from commit 8e8e0d72447f8378244f5b4a3dcde036dbeb1491)

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

 modules/demux/mp4/mp4.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c
index 0c7aa2dd50..9a70272678 100644
--- a/modules/demux/mp4/mp4.c
+++ b/modules/demux/mp4/mp4.c
@@ -447,10 +447,10 @@ static block_t * MP4_EIA608_Convert( block_t * p_block )
     } while( i_bytes >= 2 );
 
     /* cdt2 is optional */
-    if ( i_remaining >= 10 &&
-         (i_bytes = GetDWBE(p_read)) &&
-         (i_bytes <= i_remaining) &&
-         !memcmp("cdt2", &p_read[4], 4) )
+    i_bytes = GetDWBE(p_read);
+
+    if (10 <= i_bytes && i_bytes <= i_remaining &&
+        !memcmp("cdt2", &p_read[4], 4))
     {
         p_read += 8;
         i_bytes -= 8;



More information about the vlc-commits mailing list