[libdvdnav-devel] [Git][videolan/libdvdread][master] ifo_read: don't treat 0 PGCI SRP as an error

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Mon Jan 3 09:14:25 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdread


Commits:
46754b9e by Steve Lhomme at 2022-01-03T09:12:58+00:00
ifo_read: don't treat 0 PGCI SRP as an error

The comments say it exists in the wild.

calloc() may or may not return NULL in that case. Just use NULL but assume it's
not an error.

- - - - -


1 changed file:

- src/ifo_read.c


Changes:

=====================================
src/ifo_read.c
=====================================
@@ -1891,6 +1891,11 @@ static int ifoRead_PGCIT_internal(ifo_handle_t *ifofile, pgcit_t *pgcit,
      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);
   if(!data)



View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/commit/46754b9ea0090b9af0b5bbd5781b88de788e2aab

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/commit/46754b9ea0090b9af0b5bbd5781b88de788e2aab
You're receiving this email because of your account on code.videolan.org.




More information about the libdvdnav-devel mailing list