Update libdvdread to 6.1.3

Update diff from Brad, maintainer timeout
This commit is contained in:
rsadowski 2022-11-17 06:44:30 +00:00
parent 0209655200
commit b303726578
9 changed files with 4 additions and 227 deletions

View File

@ -1,8 +1,7 @@
COMMENT = accessing DVD files
VER = 6.1.2
VER = 6.1.3
DISTNAME = libdvdread-${VER}
REVISION = 0
CATEGORIES = devel
MASTER_SITES = https://download.videolan.org/pub/videolan/libdvdread/${VER}/
EXTRACT_SUFX = .tar.bz2

View File

@ -1,2 +1,2 @@
SHA256 (libdvdread-6.1.2.tar.bz2) = zBkPVTdYztdXGFnjAfgCy0gh8WTQK/rP0yDBSk4Np2M=
SIZE (libdvdread-6.1.2.tar.bz2) = 391536
SHA256 (libdvdread-6.1.3.tar.bz2) = zjVFSZeiCMvlDpEjLw5z+xrDRxllgToTuHMKjxihU2k=
SIZE (libdvdread-6.1.3.tar.bz2) = 395439

View File

@ -1,62 +0,0 @@
avoid reading the next byte ahead
f6774c386f404b49a13d9027567d57e104c5a415
Index: src/bitreader.c
--- src/bitreader.c.orig
+++ src/bitreader.c
@@ -26,12 +26,11 @@
#include "dvdread/bitreader.h"
-int dvdread_getbits_init(getbits_state_t *state, uint8_t *start) {
+int dvdread_getbits_init(getbits_state_t *state, const uint8_t *start) {
if ((state == NULL) || (start == NULL)) return 0;
state->start = start;
state->bit_position = 0;
state->byte_position = 0;
- state->byte = start[0];
return 1;
}
@@ -47,37 +46,32 @@ uint32_t dvdread_getbits(getbits_state_t *state, uint3
if ((state->bit_position) > 0) { /* Last getbits left us in the middle of a byte. */
if (number_of_bits > (8-state->bit_position)) { /* this getbits will span 2 or more bytes. */
- byte = state->byte;
+ byte = state->start[state->byte_position] << state->bit_position;
byte = byte >> (state->bit_position);
result = byte;
number_of_bits -= (8-state->bit_position);
state->bit_position = 0;
state->byte_position++;
- state->byte = state->start[state->byte_position];
} else {
- byte=state->byte;
- state->byte = state->byte << number_of_bits;
+ byte = state->start[state->byte_position] << state->bit_position;
byte = byte >> (8 - number_of_bits);
result = byte;
state->bit_position += number_of_bits; /* Here it is impossible for bit_position > 8 */
if (state->bit_position == 8) {
state->bit_position = 0;
state->byte_position++;
- state->byte = state->start[state->byte_position];
}
number_of_bits = 0;
}
}
if ((state->bit_position) == 0) {
while (number_of_bits > 7) {
- result = (result << 8) + state->byte;
+ result = (result << 8) + state->start[state->byte_position];
state->byte_position++;
- state->byte = state->start[state->byte_position];
number_of_bits -= 8;
}
if (number_of_bits > 0) { /* number_of_bits < 8 */
- byte = state->byte;
- state->byte = state->byte << number_of_bits;
+ byte = state->start[state->byte_position] << state->bit_position;
state->bit_position += number_of_bits; /* Here it is impossible for bit_position > 7 */
byte = byte >> (8 - number_of_bits);
result = (result << number_of_bits) + byte;

View File

@ -1,15 +0,0 @@
Use correct name of the libdvdcss shared library on OpenBSD.
1c031048907b72c4757926a06f2bc5fac42fba15
Index: src/dvd_input.c
--- src/dvd_input.c.orig
+++ src/dvd_input.c
@@ -346,6 +346,8 @@ int dvdinput_setup(void *priv, dvd_logger_cb *logcb)
#define CSS_LIB "libdvdcss-2.dll"
#elif defined(__OS2__)
#define CSS_LIB "dvdcss2.dll"
+#elif defined(__OpenBSD__)
+ #define CSS_LIB "libdvdcss.so"
#else
#define CSS_LIB "libdvdcss.so.2"
#endif

View File

@ -1,63 +0,0 @@
- sprintf -> strcpy
47a582c67029ce2c57e83112794a3e3f710b844b
- dvd_reader: Use realpath instead of chdir/getcwd
21e8964e71bbc743123c458a3f1a4ff544d1ed6b
Index: src/dvd_reader.c
--- src/dvd_reader.c.orig
+++ src/dvd_reader.c
@@ -29,7 +29,7 @@
#include <stdio.h> /* fprintf */
#include <errno.h> /* errno, EIN* */
#include <string.h> /* memcpy, strlen */
-#include <unistd.h> /* chdir, getcwd */
+#include <unistd.h> /* pclose */
#include <limits.h> /* PATH_MAX */
#include <dirent.h> /* opendir, readdir */
#include <ctype.h> /* isalpha */
@@ -286,7 +286,7 @@ static int initAllCSSKeys( dvd_reader_t *ctx )
for( title = 0; title < 100; title++ ) {
gettimeofday( &t_s, NULL );
if( title == 0 ) {
- sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" );
+ strcpy( filename, "/VIDEO_TS/VIDEO_TS.VOB" );
} else {
sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, 0 );
}
@@ -549,33 +549,18 @@ static dvd_reader_t *DVDOpenCommon( void *priv,
if( !(path_copy = strdup( path ) ) )
goto DVDOpen_error;
-#ifndef _WIN32 /* don't have fchdir, and getcwd( NULL, ... ) is strange */
+#ifndef _WIN32 /* win32 doesn't have realpath */
/* Also WIN32 does not have symlinks, so we don't need this bit of code. */
/* Resolve any symlinks and get the absolute dir name. */
{
- if( ( cdir = open( ".", O_RDONLY ) ) >= 0 ) {
- int retval;
- if( chdir( path_copy ) == -1 ) {
+ new_path = realpath( path_copy, NULL );
+ if( new_path == NULL ) {
goto DVDOpen_error;
}
- new_path = malloc(PATH_MAX+1);
- if(!new_path) {
- goto DVDOpen_error;
- }
- if( getcwd( new_path, PATH_MAX ) == NULL ) {
- goto DVDOpen_error;
- }
- retval = fchdir( cdir );
- close( cdir );
- cdir = -1;
- if( retval == -1 ) {
- goto DVDOpen_error;
- }
free(path_copy);
path_copy = new_path;
new_path = NULL;
- }
}
#endif

View File

@ -1,22 +0,0 @@
avoid reading the next byte ahead
f6774c386f404b49a13d9027567d57e104c5a415
Index: src/dvdread/bitreader.h
--- src/dvdread/bitreader.h.orig
+++ src/dvdread/bitreader.h
@@ -26,13 +26,12 @@ extern "C" {
#endif
typedef struct {
- uint8_t *start;
+ const uint8_t *start;
uint32_t byte_position;
uint32_t bit_position;
- uint8_t byte;
} getbits_state_t;
-int dvdread_getbits_init(getbits_state_t *state, uint8_t *start);
+int dvdread_getbits_init(getbits_state_t *state, const uint8_t *start);
uint32_t dvdread_getbits(getbits_state_t *state, uint32_t number_of_bits);
#ifdef __cplusplus

View File

@ -1,31 +0,0 @@
- ifo_types: Indent to clarify the conditions
7fc86bd0124d29130ad7d4afc10f3f4105e1c811
- ifo_types.h: Don't use attribute gcc_struct with clang
3ac6979690e7b5446928a5354b3fb579016057dd
Index: src/dvdread/ifo_types.h
--- src/dvdread/ifo_types.h.orig
+++ src/dvdread/ifo_types.h
@@ -31,14 +31,14 @@
#undef PRAGMA_PACK_END
#if defined(__GNUC__)
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
-#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
-#define ATTRIBUTE_PACKED __attribute__ ((packed,gcc_struct))
-#else
-#define ATTRIBUTE_PACKED __attribute__ ((packed))
-#endif
-#define PRAGMA_PACK 0
-#endif
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+# if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && !defined(__clang__)
+# define ATTRIBUTE_PACKED __attribute__ ((packed,gcc_struct))
+# else
+# define ATTRIBUTE_PACKED __attribute__ ((packed))
+# endif
+# define PRAGMA_PACK 0
+# endif
#endif
#if !defined(ATTRIBUTE_PACKED)

View File

@ -1,29 +0,0 @@
- ifo_read: allocate the right number of PTT
c227550889b4455bbfba51099306e78ce81b7df9
- ifo_read: don't treat 0 PGCI SRP as an error
46754b9ea0090b9af0b5bbd5781b88de788e2aab
Index: src/ifo_read.c
--- src/ifo_read.c.orig
+++ src/ifo_read.c
@@ -1240,7 +1240,7 @@ int ifoRead_VTS_PTT_SRPT(ifo_handle_t *ifofile) {
CHECK_VALUE(n % 4 == 0);
vts_ptt_srpt->title[i].nr_of_ptts = n / 4;
- vts_ptt_srpt->title[i].ptt = calloc(n, sizeof(ptt_info_t));
+ vts_ptt_srpt->title[i].ptt = calloc(n / 4, sizeof(ptt_info_t));
if(!vts_ptt_srpt->title[i].ptt) {
for(n = 0; n < i; n++)
free(vts_ptt_srpt->title[n].ptt);
@@ -1890,6 +1890,11 @@ static int ifoRead_PGCIT_internal(ifo_handle_t *ifofil
Magic Knight Rayearth Daybreak is mastered very strange and has
Titles with 0 PTTs. */
CHECK_VALUE(pgcit->nr_of_pgci_srp < 10000); /* ?? seen max of 1338 */
+
+ if (pgcit->nr_of_pgci_srp == 0) {
+ pgcit->pgci_srp = NULL;
+ return 1;
+ }
info_length = pgcit->nr_of_pgci_srp * PGCI_SRP_SIZE;
data = calloc(1, info_length);

View File

@ -18,5 +18,5 @@ share/doc/libdvdread/AUTHORS
share/doc/libdvdread/COPYING
share/doc/libdvdread/ChangeLog
share/doc/libdvdread/NEWS
share/doc/libdvdread/README
share/doc/libdvdread/README.md
share/doc/libdvdread/TODO