[vlc-commits] mux:pes: fix signed/unsigned overflow comparison

Steve Lhomme git at videolan.org
Thu Sep 7 13:00:00 CEST 2017


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Wed Aug 30 17:06:02 2017 +0200| [f90e35ca9c2bf451946a111e626b3c45fc461d87] | committer: Jean-Baptiste Kempf

mux:pes: fix signed/unsigned overflow comparison

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/mux/mpeg/pes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/mux/mpeg/pes.c b/modules/mux/mpeg/pes.c
index 4156f85946..b299241d85 100644
--- a/modules/mux/mpeg/pes.c
+++ b/modules/mux/mpeg/pes.c
@@ -367,7 +367,7 @@ void EStoPES ( block_t **pp_pes,
             offset++;
         }
         offset++;
-        if( offset <= p_es->i_buffer-4 &&
+        if( offset+4 <= p_es->i_buffer &&
             ((p_es->p_buffer[offset] & 0x1f) != 9) ) /* Not AUD */
         {
             /* Make similar AUD as libavformat does */



More information about the vlc-commits mailing list