File gstreamer-CVE-2022-1920.patch of Package gstreamer-0_10-plugins-good.25653
diff -urp gst-plugins-good-0.10.31.orig/gst/matroska/matroska-demux.c gst-plugins-good-0.10.31/gst/matroska/matroska-demux.c
--- gst-plugins-good-0.10.31.orig/gst/matroska/matroska-demux.c 2012-02-15 17:45:58.000000000 -0600
+++ gst-plugins-good-0.10.31/gst/matroska/matroska-demux.c 2022-08-22 13:15:45.960077596 -0500
@@ -2790,7 +2790,8 @@ gst_matroska_demux_add_wvpk_header (GstE
guint8 *outdata;
guint outpos = 0;
guint size;
- guint32 block_samples, flags, crc, blocksize;
+ guint32 block_samples, flags, crc;
+ gsize blocksize;
data = GST_BUFFER_DATA (*buf);
size = GST_BUFFER_SIZE (*buf);
@@ -2815,6 +2816,11 @@ gst_matroska_demux_add_wvpk_header (GstE
data += 4;
size -= 4;
+ if (blocksize > G_MAXSIZE - 32) {
+ GST_ERROR_OBJECT (element, "Too big wavpack buffer");
+ return GST_FLOW_ERROR;
+ }
+
if (blocksize == 0 || size < blocksize)
break;