summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2023-07-07 10:00:19 +0300
committerTim-Philipp Müller <tim@centricular.com>2023-07-20 00:23:36 +0100
commit45a0654eff64a9acefde7ba8f0cf002501e53888 (patch)
treeec654d5289a61287609f4272846b46d482502cce
parent40440bce66af6ab43690d3ce7c4f4296a6b7e7b9 (diff)
rmdemux: Check that enough SIPR audio data is available when copying
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5077>
-rw-r--r--subprojects/gst-plugins-ugly/gst/realmedia/rmdemux.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/subprojects/gst-plugins-ugly/gst/realmedia/rmdemux.c b/subprojects/gst-plugins-ugly/gst/realmedia/rmdemux.c
index eaee9acdd1..902092b24b 100644
--- a/subprojects/gst-plugins-ugly/gst/realmedia/rmdemux.c
+++ b/subprojects/gst-plugins-ugly/gst/realmedia/rmdemux.c
@@ -2168,7 +2168,13 @@ gst_rmdemux_descramble_sipr_audio (GstRMDemux * rmdemux,
GST_BUFFER_PTS (outbuf) = GST_BUFFER_PTS (b);
}
- gst_buffer_extract (b, 0, outmap.data + packet_size * p, packet_size);
+ if (gst_buffer_extract (b, 0, outmap.data + packet_size * p,
+ packet_size) != packet_size) {
+ GST_ERROR_OBJECT (rmdemux, "not enough SIPR audio data available");
+ gst_buffer_unmap (outbuf, &outmap);
+ gst_buffer_unref (outbuf);
+ return GST_FLOW_ERROR;
+ }
}
gst_buffer_unmap (outbuf, &outmap);