amc: Fix call to realloc() to allocate the correct size of items

This commit is contained in:
Sebastian Dröge 2016-08-08 11:28:44 +02:00
parent 31fffdad10
commit 3db0fa37b7

View file

@ -1867,7 +1867,8 @@ scan_codecs (GstPlugin * plugin)
tmp->gl_output_only |= gst_codec_info->gl_output_only; tmp->gl_output_only |= gst_codec_info->gl_output_only;
tmp->n_supported_types += gst_codec_info->n_supported_types; tmp->n_supported_types += gst_codec_info->n_supported_types;
tmp->supported_types = tmp->supported_types =
g_realloc (tmp->supported_types, tmp->n_supported_types); g_realloc (tmp->supported_types,
tmp->n_supported_types * sizeof (GstAmcCodecType));
for (n = 0; n < gst_codec_info->n_supported_types; n++, m++) { for (n = 0; n < gst_codec_info->n_supported_types; n++, m++) {
tmp->supported_types[m] = gst_codec_info->supported_types[n]; tmp->supported_types[m] = gst_codec_info->supported_types[n];