riff-media: Check if caps are NULL before using them for the first time, not afterwards

Otherwise we'll get a g_critical() before erroring out cleanly on
https://samples.mplayerhq.hu/A-codecs/ATRAC3/SND0.AT3
This commit is contained in:
Sebastian Dröge 2016-11-26 13:53:49 +02:00
parent 69c1e0d7a9
commit 0846eb5b27

View file

@ -1732,6 +1732,11 @@ gst_riff_create_audio_caps (guint16 codec_id,
*codec_name = g_strdup ("Ogg-AVI");
}
if (caps == NULL) {
GST_WARNING ("Unknown WAVE_FORMAT_EXTENSIBLE audio format");
return NULL;
}
if (strf != NULL) {
/* If channel_mask == 0 and channels > 1 let's
* assume default layout as some wav files don't have the
@ -1750,10 +1755,6 @@ gst_riff_create_audio_caps (guint16 codec_id,
rate_chan = FALSE;
}
if (caps == NULL) {
GST_WARNING ("Unknown WAVE_FORMAT_EXTENSIBLE audio format");
return NULL;
}
break;
}
/* can anything decode these? pitfdll? */