[vlc-commits] DVDread: avoid crashes over invalid cell_playback_offset values

Jean-Baptiste Kempf git at videolan.org
Tue Feb 26 11:42:24 CET 2013


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Tue Feb 26 11:37:36 2013 +0100| [0019260703fb38b15403e8c41c6110d9c79a36f1] | committer: Jean-Baptiste Kempf

DVDread: avoid crashes over invalid cell_playback_offset values

Ref #8125

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

 modules/access/dvdread.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/modules/access/dvdread.c b/modules/access/dvdread.c
index 93c3c29..79d8304 100644
--- a/modules/access/dvdread.c
+++ b/modules/access/dvdread.c
@@ -755,6 +755,12 @@ static int DvdReadSetArea( demux_t *p_demux, int i_title, int i_chapter,
         pgn = p_vts->vts_ptt_srpt->title[p_sys->i_ttn - 1].ptt[0].pgn;
         p_pgc = p_vts->vts_pgcit->pgci_srp[pgc_id - 1].pgc;
 
+        if( p_pgc->cell_playback == NULL )
+        {
+            msg_Err( p_demux, "Invalid PGC (cell_playback_offset)" );
+            return VLC_EGENERIC;
+        }
+
         p_sys->i_title_start_cell =
             i_start_cell = p_pgc->program_map[pgn - 1] - 1;
         p_sys->i_title_start_block =
@@ -999,6 +1005,8 @@ static int DvdReadSetArea( demux_t *p_demux, int i_title, int i_chapter,
                   p_sys->i_ttn - 1].ptt[i_chapter].pgn;
 
         p_pgc = p_vts->vts_pgcit->pgci_srp[pgc_id - 1].pgc;
+        if( p_pgc->cell_playback == NULL )
+            return VLC_EGENERIC; /* Couldn't set chapter */
 
         p_sys->i_cur_cell = p_pgc->program_map[pgn - 1] - 1;
         p_sys->i_chapter = i_chapter;



More information about the vlc-commits mailing list