asfdemux: Fix payloads check

Don't iterate stream->payloads if ... it doesn't exist

CID #1139846
This commit is contained in:
Edward Hervey 2014-04-03 15:06:22 +02:00
parent ecf7b967f9
commit fffcbfc127

View file

@ -155,16 +155,16 @@ gst_asf_demux_free_stream (GstASFDemux * demux, AsfStream * stream)
stream->pad = NULL;
}
while (stream->payloads->len > 0) {
AsfPayload *payload;
guint last;
last = stream->payloads->len - 1;
payload = &g_array_index (stream->payloads, AsfPayload, last);
gst_buffer_replace (&payload->buf, NULL);
g_array_remove_index (stream->payloads, last);
}
if (stream->payloads) {
while (stream->payloads->len > 0) {
AsfPayload *payload;
guint last;
last = stream->payloads->len - 1;
payload = &g_array_index (stream->payloads, AsfPayload, last);
gst_buffer_replace (&payload->buf, NULL);
g_array_remove_index (stream->payloads, last);
}
g_array_free (stream->payloads, TRUE);
stream->payloads = NULL;
}