[vlc-commits] ps: Fix invalid read

Hugo Beauzée-Luyssen git at videolan.org
Mon Aug 21 16:42:28 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Aug 21 16:30:01 2017 +0200| [f4f8334b75573d3ffd3e7bec2f7861600947437e] | committer: Hugo Beauzée-Luyssen

ps: Fix invalid read

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

 modules/demux/mpeg/ps.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/modules/demux/mpeg/ps.h b/modules/demux/mpeg/ps.h
index 932178ae59..8af30dfb0e 100644
--- a/modules/demux/mpeg/ps.h
+++ b/modules/demux/mpeg/ps.h
@@ -601,8 +601,9 @@ static inline void ps_parse_descriptors( const uint8_t *p_data, size_t i_data,
             default:
                 break;
         }
-        p_data += 2 + p_data[1];
-        i_data -= 2 + p_data[1];
+        uint8_t i_desc_size = p_data[1];
+        p_data += 2 + i_desc_size;
+        i_data -= 2 + i_desc_size;
     }
 }
 



More information about the vlc-commits mailing list