File CVE-2024-47538.patch of Package gstreamer-plugins-base.36923

From 5093691ef2ef5c7a6e03a20bce39db143b9cdc43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
Date: Mon, 30 Sep 2024 21:35:07 +0300
Subject: [PATCH] vorbisdec: Set at most 64 channels to NONE position

Thanks to Antonio Morales for finding and reporting the issue.

Fixes GHSL-2024-115
Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/3869

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8035>
---
diff -urp gst-plugins-base-1.24.7.orig/ext/vorbis/gstvorbisdec.c gst-plugins-base-1.24.7/ext/vorbis/gstvorbisdec.c
--- gst-plugins-base-1.24.7.orig/ext/vorbis/gstvorbisdec.c	2024-08-21 07:25:15.000000000 -0400
+++ gst-plugins-base-1.24.7/ext/vorbis/gstvorbisdec.c	2024-12-16 03:10:04.797186356 -0500
@@ -204,7 +204,7 @@ vorbis_handle_identification_packet (Gst
     }
     default:{
       GstAudioChannelPosition position[64];
-      gint i, max_pos = MAX (vd->vi.channels, 64);
+      gint i, max_pos = MIN (vd->vi.channels, 64);
 
       GST_ELEMENT_WARNING (vd, STREAM, DECODE,
           (NULL), ("Using NONE channel layout for more than 8 channels"));
openSUSE Build Service is sponsored by