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

git version control git at videolan.org
Thu Oct 2 22:12:58 CEST 2008


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

dvdread: minimum value for ps_pkt_size is 6

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

 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 a628ccc..3e51aad 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