[libdvdnav-devel] [Git][videolan/libdvdnav][master] Fix null pointer dereference of cell_playback in play_Cell and play_Cell_post
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Fri Aug 7 17:00:02 UTC 2026
Jean-Baptiste Kempf pushed to branch master at VideoLAN / libdvdnav
Commits:
2ffc50b5 by Aaron Wood at 2026-08-07T18:59:38+02:00
Fix null pointer dereference of cell_playback in play_Cell and play_Cell_post
When parsing malformed or obfuscated DVDs where a PGC reports nr_of_cells > 0
but has a NULL cell_playback table, accessing cell_playback triggers a segfault.
This adds a NULL check before dereferencing cell_playback in both play_Cell
and play_Cell_post. If the table is missing, it gracefully bails out via
play_PGC_post(vm), avoiding a crash.
- - - - -
1 changed file:
- src/vm/play.c
Changes:
=====================================
src/vm/play.c
=====================================
@@ -211,6 +211,11 @@ link_t play_Cell(vm_t *vm) {
return play_PGC_post(vm);
}
+ if ((vm->state).pgc->cell_playback == NULL) {
+ /* Invalid PGC: cell_playback is missing */
+ return play_PGC_post(vm);
+ }
+
/* Multi angle/Interleaved */
switch((vm->state).pgc->cell_playback[(vm->state).cellN - 1].block_mode) {
case 0: /* Normal */
@@ -274,6 +279,11 @@ link_t play_Cell_post(vm_t *vm) {
Log3(vm, "play_Cell_post: (vm->state).cellN (%i)", (vm->state).cellN);
#endif
+ if ((vm->state).pgc->cell_playback == NULL) {
+ /* Invalid PGC: cell_playback is missing */
+ return play_PGC_post(vm);
+ }
+
cell = &(vm->state).pgc->cell_playback[(vm->state).cellN - 1];
/* Still time is already taken care of before we get called. */
View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/commit/2ffc50b5c37a6ddc086829203fc44e95588198dd
--
View it on GitLab: https://code.videolan.org/videolan/libdvdnav/-/commit/2ffc50b5c37a6ddc086829203fc44e95588198dd
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