[vlc-commits] [Git][videolan/vlc][master] access: cdrom: check for read truncations

Steve Lhomme (@robUx4) gitlab at videolan.org
Thu May 21 07:44:48 UTC 2026



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
75482690 by François Cartegnie at 2026-05-21T07:25:59+00:00
access: cdrom: check for read truncations

- - - - -


1 changed file:

- modules/access/vcd/cdrom.c


Changes:

=====================================
modules/access/vcd/cdrom.c
=====================================
@@ -587,8 +587,8 @@ int ioctl_ReadSectors( vlc_object_t *p_this, const vcddev_t *p_vcddev,
             goto error;
         }
 
-        if( read( p_vcddev->i_vcdimage_handle, p_block, VCD_SECTOR_SIZE * i_nb)
-            == -1 )
+        ssize_t toread = VCD_SECTOR_SIZE * i_nb;
+        if( read( p_vcddev->i_vcdimage_handle, p_block, toread ) != toread )
         {
             msg_Err( p_this, "Could not read sector %d", i_sector );
             goto error;
@@ -724,8 +724,8 @@ int ioctl_ReadSectors( vlc_object_t *p_this, const vcddev_t *p_vcddev,
             goto error;
         }
 
-        if( read( p_vcddev->i_device_handle,
-                  p_block, VCD_SECTOR_SIZE * i_nb ) == -1 )
+        ssize_t toread = VCD_SECTOR_SIZE * i_nb;
+        if( read( p_vcddev->i_device_handle, p_block, toread ) != toread )
         {
             msg_Err( p_this, "Could not read sector %d", i_sector );
             goto error;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7548269057a34338f4f212e00e0958f20202b8ae

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/7548269057a34338f4f212e00e0958f20202b8ae
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 vlc-commits mailing list