diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2021-05-22 01:53:43 +0100 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-06-02 12:39:53 +0000 |
commit | cc1a7e2c4d10ab118d635a9db163440bc9d96dd0 (patch) | |
tree | 399f32ad643394d961926eabedc3c54d37104841 /gst/asfdemux | |
parent | caae1a632aac657dc68bfc153580718353716e51 (diff) | |
download | gstreamer-plugins-ugly-cc1a7e2c4d10ab118d635a9db163440bc9d96dd0.tar.gz |
Use g_memdup2() where available and add fallback for older GLib versions
- x264 encoder bitrate profile manager: alloc size is based
on existing allocation
- asfdemux: change length var to 64-bit and check for G_MAXUINT
- realmedia: opaque_data_len is read from 32 bits and then
only subtracted upon.
g_memdup() is deprecated since GLib 2.68 and we want to avoid
deprecation warnings with recent versions of GLib.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-ugly/-/merge_requests/83>
Diffstat (limited to 'gst/asfdemux')
-rw-r--r-- | gst/asfdemux/gstasfdemux.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gst/asfdemux/gstasfdemux.c b/gst/asfdemux/gstasfdemux.c index 2cf236c9..0c8dc848 100644 --- a/gst/asfdemux/gstasfdemux.c +++ b/gst/asfdemux/gstasfdemux.c @@ -2458,15 +2458,18 @@ gst_asf_demux_get_buffer (GstBuffer ** p_buf, guint num_bytes_to_read, } static gboolean -gst_asf_demux_get_bytes (guint8 ** p_buf, guint num_bytes_to_read, +gst_asf_demux_get_bytes (guint8 ** p_buf, guint64 num_bytes_to_read, guint8 ** p_data, guint64 * p_size) { *p_buf = NULL; + if (num_bytes_to_read >= G_MAXUINT) + return FALSE; + if (*p_size < num_bytes_to_read) return FALSE; - *p_buf = g_memdup (*p_data, num_bytes_to_read); + *p_buf = g_memdup2 (*p_data, num_bytes_to_read); *p_data += num_bytes_to_read; *p_size -= num_bytes_to_read; return TRUE; |