[vlc-devel] commit: dvdread: minimum value for ps_pkt_size is 6 (Derk-Jan Hartman )

git version control git at videolan.org
Mon Oct 6 15:01:06 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Thu Oct  2 22:10:52 2008 +0200| [76003f0e6cd54217619b68537ba73c089c60c8ed] | committer: Derk-Jan Hartman 

dvdread: minimum value for ps_pkt_size is 6
(cherry picked from commit b1aa0a1a872627bb6bf6d94fea8145f4b6c3fccd)

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

 modules/access/dvdread.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index 48671c5..8e1757a 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -603,10 +603,15 @@ static int DemuxBlock( demux_t *p_demux, uint8_t *pkt, int i_pkt )
     demux_sys_t *p_sys = p_demux->p_sys;
     uint8_t     *p = pkt;
 
-    while( p < &pkt[i_pkt] )
+    while( p && p < &pkt[i_pkt] )
     {
-        int i_size = ps_pkt_size( p, &pkt[i_pkt] - p );
         block_t *p_pkt;
+        int i_size = &pkt[i_pkt] - p;
+
+        if( i_size < 6 )
+            break;
+ 
+        i_size = ps_pkt_size( p, i_size );
         if( i_size <= 0 )
         {
             break;




More information about the vlc-devel mailing list