* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
#include "gstencoderbitrateprofilemanager.h"
* self, const gchar * profile_name,
const GstEncoderBitrateTargetForPixelsMap * map)
{
- gint n_vals;
+ guint n_vals;
GstEncoderBitrateProfile *profile;
for (n_vals = 0;
profile->name = g_strdup (profile_name);
profile->n_vals = n_vals;
profile->map
- = g_memdup (map, sizeof (GstEncoderBitrateTargetForPixelsMap) * n_vals);
+ = g_memdup2 (map, sizeof (GstEncoderBitrateTargetForPixelsMap) * n_vals);
self->profiles = g_list_prepend (self->profiles, profile);
}
}
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;
if (strncmp (opaque_data, "MLTI", 4)) {
GST_DEBUG_OBJECT (ctx, "no MLTI found, appending all");
stream->type_specific_data_len = opaque_data_len;
- stream->type_specific_data = g_memdup (opaque_data, opaque_data_len);
+ stream->type_specific_data = g_memdup2 (opaque_data, opaque_data_len);
goto no_type_specific;
}
opaque_data += 4;
goto strange_opaque_data;
}
stream->type_specific_data =
- g_memdup (opaque_data, stream->type_specific_data_len);
+ g_memdup2 (opaque_data, stream->type_specific_data_len);
no_type_specific:
size =
have_cxx = add_languages('cpp', native: false, required: false)
-glib_req = '>= 2.44.0'
+glib_req = '>= 2.56.0'
gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
api_version = '1.0'
gmodule_dep = dependency('gmodule-2.0', fallback : ['glib', 'libgmodule_dep'])
+if gmodule_dep.version().version_compare('< 2.67.4')
+ cdata.set('g_memdup2(ptr,sz)', '(G_LIKELY(((guint64)(sz)) < G_MAXUINT)) ? g_memdup(ptr,sz) : (g_abort(),NULL)')
+endif
+
ugly_args = ['-DHAVE_CONFIG_H']
configinc = include_directories('.')
libsinc = include_directories('gst-libs')