[libdvdnav-devel] [Git][videolan/libdvdread][master] Fix mixed signess in ifo_read

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Sat Jul 4 17:48:17 UTC 2026



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


Commits:
980143e2 by Jean-Baptiste Kempf at 2026-07-04T19:47:42+02:00
Fix mixed signess in ifo_read

- - - - -


1 changed file:

- src/ifo_read.c


Changes:

=====================================
src/ifo_read.c
=====================================
@@ -1934,9 +1934,13 @@ static int ifoRead_PGC_COMMAND_TBL(ifo_handle_t *ifofile,
   B2N_16(cmd_tbl->nr_of_cell);
   B2N_16(cmd_tbl->last_byte);
 
-  CHECK_VALUE(cmd_tbl->nr_of_pre + cmd_tbl->nr_of_post + cmd_tbl->nr_of_cell<= 255);
-  CHECK_VALUE((cmd_tbl->nr_of_pre + cmd_tbl->nr_of_post + cmd_tbl->nr_of_cell) * COMMAND_DATA_SIZE
-              + PGC_COMMAND_TBL_SIZE <= cmd_tbl->last_byte + 1);
+  uint32_t nr_cmds = (uint32_t)cmd_tbl->nr_of_pre
+                   + (uint32_t)cmd_tbl->nr_of_post
+                   + (uint32_t)cmd_tbl->nr_of_cell;
+
+  CHECK_VALUE(nr_cmds <= 255);
+  CHECK_VALUE(nr_cmds * COMMAND_DATA_SIZE + PGC_COMMAND_TBL_SIZE
+              <= (uint32_t)cmd_tbl->last_byte + 1U);
 
   if(cmd_tbl->nr_of_pre != 0) {
     unsigned int pre_cmds_size  = cmd_tbl->nr_of_pre * COMMAND_DATA_SIZE;



View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/commit/980143e2192aded576c54a60dd230fa22937b637

-- 
View it on GitLab: https://code.videolan.org/videolan/libdvdread/-/commit/980143e2192aded576c54a60dd230fa22937b637
You're receiving this email because of your account on code.videolan.org. Manage all notifications: https://code.videolan.org/-/profile/notifications | Help: https://code.videolan.org/help




More information about the libdvdnav-devel mailing list