From 9278f9b128ff2008e0bac9e4fc3e131d069b936a Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 25 Jun 2007 07:22:10 +0000 Subject: [PATCH] ext/dvdread/dvdreadsrc.c: If we can't read a nav packet, or it doesn't look like a nav packet, that's an error. Prev... Original commit message from CVS: * ext/dvdread/dvdreadsrc.c: If we can't read a nav packet, or it doesn't look like a nav packet, that's an error. Previous behavior was to look at the next packet; I can't find any justification for doing that. Fixes: #358891. --- ChangeLog | 8 ++++++++ ext/dvdread/dvdreadsrc.c | 12 ++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 67f01a9f22..b576fcdcf1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-06-25 David Schleef + + * ext/dvdread/dvdreadsrc.c: + If we can't read a nav packet, or it doesn't look like a nav + packet, that's an error. Previous behavior was to look at + the next packet; I can't find any justification for doing that. + Fixes: #358891. + 2007-06-24 Thomas Vander Stichele * po/it.po: diff --git a/ext/dvdread/dvdreadsrc.c b/ext/dvdread/dvdreadsrc.c index c7660769fb..38f2579670 100644 --- a/ext/dvdread/dvdreadsrc.c +++ b/ext/dvdread/dvdreadsrc.c @@ -777,21 +777,21 @@ again: } /* read NAV packet */ -nav_retry: - len = DVDReadBlocks (src->dvd_title, src->cur_pack, 1, oneblock); if (len == 0) goto read_error; if (!gst_dvd_read_src_is_nav_pack (oneblock)) { - GST_LOG_OBJECT (src, "Skipping nav packet @ pack %d", src->cur_pack); - src->cur_pack++; - goto nav_retry; + GST_LOG_OBJECT (src, "Expected nav packet @ pack %d", src->cur_pack); + goto read_error; } /* parse the contained dsi packet */ navRead_DSI (&dsi_pack, &oneblock[DSI_START_BYTE]); - g_assert (src->cur_pack == dsi_pack.dsi_gi.nv_pck_lbn); + if (src->cur_pack != dsi_pack.dsi_gi.nv_pck_lbn) { + GST_ERROR ("src->cur_pack = %d, dsi_pack.dsi_gi.nv_pck_lbn = %d", + src->cur_pack, dsi_pack.dsi_gi.nv_pck_lbn); + } /* determine where we go next. These values are the ones we * mostly care about */