35 lines
1.3 KiB
Diff
35 lines
1.3 KiB
Diff
|
From ad5393302d9d28b25b10f93375ca43e37661779a Mon Sep 17 00:00:00 2001
|
||
|
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
|
||
|
Date: Fri, 4 Oct 2024 13:51:00 +0300
|
||
|
Subject: [PATCH 10/28] wavparse: Check size before reading ds64 chunk
|
||
|
|
||
|
Thanks to Antonio Morales for finding and reporting the issue.
|
||
|
|
||
|
Fixes GHSL-2024-261
|
||
|
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3889
|
||
|
|
||
|
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8042>
|
||
|
---
|
||
|
subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c | 5 +++++
|
||
|
1 file changed, 5 insertions(+)
|
||
|
|
||
|
diff --git a/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c b/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c
|
||
|
index 2499416a76..f2fa1e45c5 100644
|
||
|
--- a/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c
|
||
|
+++ b/subprojects/gst-plugins-good/gst/wavparse/gstwavparse.c
|
||
|
@@ -1087,6 +1087,11 @@ parse_ds64 (GstWavParse * wav, GstBuffer * buf)
|
||
|
guint32 sampleCountLow, sampleCountHigh;
|
||
|
|
||
|
gst_buffer_map (buf, &map, GST_MAP_READ);
|
||
|
+ if (map.size < 6 * 4) {
|
||
|
+ GST_WARNING_OBJECT (wav, "Too small ds64 chunk (%" G_GSIZE_FORMAT ")",
|
||
|
+ map.size);
|
||
|
+ return FALSE;
|
||
|
+ }
|
||
|
dataSizeLow = GST_READ_UINT32_LE (map.data + 2 * 4);
|
||
|
dataSizeHigh = GST_READ_UINT32_LE (map.data + 3 * 4);
|
||
|
sampleCountLow = GST_READ_UINT32_LE (map.data + 4 * 4);
|
||
|
--
|
||
|
2.47.0
|
||
|
|