asfdemux: Reset number of languages to 0 when freeing the array because of errors

Otherwise we will happily index into the array at NULL if the requested
index is smaller than the number of languages that were previously
allocated.

https://bugzilla.gnome.org/show_bug.cgi?id=777937
This commit is contained in:
Sebastian Dröge 2017-01-30 15:39:59 +02:00
parent bf8835a7df
commit dec880031d

View file

@ -3962,6 +3962,7 @@ not_enough_data:
GST_WARNING_OBJECT (demux, "short read parsing language list object!"); GST_WARNING_OBJECT (demux, "short read parsing language list object!");
g_free (demux->languages); g_free (demux->languages);
demux->languages = NULL; demux->languages = NULL;
demux->num_languages = 0;
return GST_FLOW_OK; /* not fatal */ return GST_FLOW_OK; /* not fatal */
} }
} }