summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Nauwelaerts <mnauw@users.sourceforge.net>2024-03-16 19:32:19 +0100
committerTim-Philipp Müller <tim@centricular.com>2024-03-18 20:37:12 +0000
commit682c749ac13730d49624d88419e92fe19d1d0848 (patch)
tree05e58f30c3e4a1ee54a952b0307ba7b2ee50804a
parenta81772f9f562129a31eab0456d7fad97b65d6b6b (diff)
dvdspu: avoid null dereference
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6390>
-rw-r--r--subprojects/gst-plugins-bad/gst/dvdspu/gstspu-pgs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/subprojects/gst-plugins-bad/gst/dvdspu/gstspu-pgs.c b/subprojects/gst-plugins-bad/gst/dvdspu/gstspu-pgs.c
index df0b8e2cbe..684c320a65 100644
--- a/subprojects/gst-plugins-bad/gst/dvdspu/gstspu-pgs.c
+++ b/subprojects/gst-plugins-bad/gst/dvdspu/gstspu-pgs.c
@@ -584,6 +584,11 @@ parse_set_object_data (GstDVDSpu * dvdspu, guint8 type, guint8 * payload,
PGS_DUMP ("Object ID %d ver %u flags 0x%02x\n", obj_id, obj_ver, flags);
+ if (!obj) {
+ GST_ERROR ("unknown Object ID %d", obj_id);
+ return 0;
+ }
+
if (flags & PGS_OBJECT_UPDATE_FLAG_START_RLE) {
obj->rle_data_ver = obj_ver;