Skip to content
Snippets Groups Projects
  1. Feb 06, 2013
  2. Feb 05, 2013
    • Fabian Keil's avatar
      Let dvdnav_describe_title_chapters() skip PGCs with missing cells · 72b60e1c
      Fabian Keil authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      
      Fixes segfaults with a rip of Ghost Protocol.
      
      Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
      72b60e1c
    • Fabian Keil's avatar
      Add a couple of additional sanity checks for dvdnav_describe_title_chapters() · b82d643c
      Fabian Keil authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      
      Fixes crashes with non-compliant DVDs after applying
      the duplicate detection patch for libdvdread.
      
      It might make more sense to do those checks in libdvdread
      instead and zero out structures that don't check out.
      
      Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
      b82d643c
    • Jean-Baptiste Kempf's avatar
      Fix broken logic · c01204f7
      Jean-Baptiste Kempf authored
      c01204f7
    • Erik Hovland's avatar
      Make examples optional · 7fe48aba
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      There was a time where dvdnav examples failed to build on mingw.  Rather
      than fix them, we just disabled examples since we had no need for them.
      Although the examples seem to build fine now, this option may be useful
      in general.
      
      Patch provided by John Stebbins (stebbins AT jetheaddev DOT come),
      thanks!
      7fe48aba
    • Mirakels's avatar
      dvdnav_sector_search: allow backward search for SEEK_CUR · 1a2014b5
      Mirakels authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      As offset was an uint64_t offset could not be negative. Seeking
      backwards is then only possible by get_position(), substract an
      offset and do a SEEK_SET.
      Now with a signed offset SEEK_CUR can be used to go backwards
      without getting the current position first.
      1a2014b5
    • Mirakels's avatar
      dvdnav_get_position: fix calculation for multi-angle DVDs · 938ee3f5
      Mirakels authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      This also fixes wrong positioning in dvdnav_sector_search() for
      multi-angle DVDS.
      BLOCK_TYPE_ANGLE_BLOCK cells seem to overlap sectors in the previous
      cell hence they should be skipped when adding cell lengths up to get
      to the correct sector.
      
      dvdnav_sector_search() already checks for BLOCK_TYPE_ANGLE_BLOCK
      cells in calculating the new position but dvdnav_get_position()
      did not. As dvdnav_sector_search() starts by calling
      dvdnav_get_position() the end result for the new position could
      be wrong.
      938ee3f5
    • Erik Hovland's avatar
      Skip PGCs w/ a cell number of 0 · 562415de
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      If the cell number is 0 dvdnav will crash w/ a SIGBUS. Check the cell
      number before this can happen and just continue.
      562415de
    • Erik Hovland's avatar
      Ignore parts where the pgc start byte is above the last byte · 3eec8b8f
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      If the start byte is in the wrong place then dvdnav can crash because it
      is out of bounds.
      3eec8b8f
    • Erik Hovland's avatar
      Make sure pgc is valid before dereferencing. · 230fa48e
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      The pgc pointer might be null when it is retrieved from the IFO. This
      can cause a segfault when pgc is dereferenced a few lines later.
      230fa48e
    • Erik Hovland's avatar
      Check that a VOB is open in case we need to open one · a1c42a57
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      If a VOB is not open we will dereference a null pointer in
      DVDReadBlocks. That will produce a segfault. If we check for an open VOB
      when we check to see if we need to change the currently open VOB we can
      ensure that a VOB is open when DVDReadBlocks dereferences it.
      
      This patch supplied by John Stebbins <stebbins AT jetheaddev DOT com>.
      a1c42a57
    • Erik Hovland's avatar
      Adds a function to create a dpu of a dvdnav handle · 23c5a6e1
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      This adds a function to create a duplicate of a dvdnav handle and it's
      state. This allows you to recursively move through the handle. HandBrake
      uses these functions to do recursive automated search of the menus for
      something that looks like the main feature.
      23c5a6e1
    • Erik Hovland's avatar
      Reset the vm if necessary. · 77970d32
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      When vm_start is called it should check to see if the vm is stopped. If
      it is, reset it and marked the vm as started (set vm->stopped to zero).
      77970d32
    • Erik Hovland's avatar
      Use vm_close() w/in vm.c where appropriate · 7ff12fe7
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      Replace vm_stop() w/ vm_close() where necessary.
      7ff12fe7
    • Erik Hovland's avatar
      Add the static function vm_close() · f87fc6c7
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      It is convenient to have vm_stop() have different processing when called
      by other parts of the library. When vm_stop is changed in this way, it
      means that the vm needs to be able to do the same processing internally.
      The introduction of the static function vm_close() provides that
      processing.
      f87fc6c7
    • Erik Hovland's avatar
      Add in endian detection to configure2 · 9d8c94f5
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      libdvdnav's configure2 lacked endian detection. This problem was pointed
      out by Ganael Laplanche <ganael DOT laplanche AT martymac DOT org>
      through a patch that he submitted to fix this issue (and others) for the
      BSDs. Thanks!
      9d8c94f5
    • Erik Hovland's avatar
      check pkg-config before xxx-config scripts · a77da0d0
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      It's easier to manage pkg-config when cross-compiling, and libdvdread
      installs .pc files, so check those first.
      
      Patch provided by Mike Frysinger <vapier AT gentoo DOT org>, Thanks!
      a77da0d0
    • Erik Hovland's avatar
      libdvdnavmini depends on libdvdread · fb3f2cc4
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      This patch fixes the following error messages one might get when
      building libdvdnav on W32 using MinGW:
      
      libtool: link:  gcc -shared .libs/libdvdnavmini-4.dll.def
      .libs/dvdnav.o .libs/read_cache.o .libs/navigation.o .libs/highlight.o
      .libs/searching.o .libs/settings.o .libs/remap.o  -Wl,--whole-archive
      ../src/vm/.libs/libdvdvm.a -Wl,--no-whole-archive   -O3 -march=i686
      - -o .libs/libdvdnavmini-4.dll -Wl,--enable-auto-image-base -Xlinker
      - --out-implib -Xlinker .libs/libdvdnavmini.dll.a
      Creating library file:
      .libs/libdvdnavmini.dll.a.libs/dvdnav.o:dvdnav.c:(.text+0x27):
      undefined reference to `DVDCloseFile'
      
      Patch provided by LRN <lrn1986 AT gmail DOT com>, Thanks!
      fb3f2cc4
    • Erik Hovland's avatar
      Check cell new row before using it to index into cell_playback · bdab7143
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      cellnr is used to index into cell_playback after subtracting
      one from it. If cellnr is 0, then it will index -1 in cell_playback
      which will seek out of boundary of cell_playback. This manifested into a
      segfault for some users as reported by this launchpad bug:
      https://bugs.launchpad.net/ubuntu/+source/libdvdnav/+bug/934471
      
      By checking cellnr and skipping the indexing if cellnr is equal to zero
      then we avoid the segfault. There might be a bigger issue w/ regard to
      retrieving a value of zero for cell new row, but this fix works for the
      reporter.
      
      Thanks goes to Sylvain Henry (hsyl20 AT gmail DOT com for both
      reporting the bug to launchpad and submitting a potential patch (even
      though we went w/ a different fix).
      bdab7143
    • Erik Hovland's avatar
      Prevent overflow by pre-casting to int64_t · be3167b2
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      When converting to ticks it is possible for the first value to overflow.
      We can prevent this overflow if we cast the first value to int64_t
      before multiplying. This will cause the compiler to use int64_t as the
      base type for the operations.
      be3167b2
    • Erik Hovland's avatar
      Check the return value of dvd_read_name · f5caa610
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      Now that dvd_read_name returns a status code we can check it before
      calling remap_loadmap.
      f5caa610
    • Erik Hovland's avatar
      Rewrite dvd_read_name to return a value · 72d5d128
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      dvd_read_name has several places where it can fail. Since it doesn't
      return a value it can't communicate that to any callers. This commit
      changes the function so it does all of the same work but it checks every
      possible failure point.
      72d5d128
    • Erik Hovland's avatar
      Prevent general CPP macro from causing strange behavior. · fb149ce7
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      Roger Pack reported that when playing the DVD "Tangled"
      w/ mplayer and recent libdvdnav, mplayer crashes w/ the error message:
      Assertion failed: (vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode != 0, file libdvdnav/vm/vm.c, line 1141
      
      This line should only be triggered when a developer wants a "strict"
      build of the library. Most likely using the very general term
      STRICT to #ifdef this clause is what is causing this issue. This
      patch adds a DVDNAV_ in front of the strict to prevent the
      macro from being enabled accidentally.
      fb149ce7
    • Erik Hovland's avatar
      Remove unneeded address-of of CLUT · f3422ff9
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      The CLUT that is copied in from struct variable palette is an
      array of 16 values. So the &(palette) is unnecessary. The size
      argument was also changed to use the palette array instead of
      the type (just in case palette ever gets changed).
      
      Thanks goes to Lee Essen who originally submitted the patch
      way back in 2008 and to Roger Pack who brought the patch to
      our attention recently.
      f3422ff9
    • Erik Hovland's avatar
      Initialize next_vobu. · 533576e7
      Erik Hovland authored and Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf committed
      It is possible (although unlikely) that the while loop will
      never execute and next_vobu will be uninitialized at this point.
      533576e7
Loading