avidemux: rearrange some checks to avoid NULL use

This commit is contained in:
Mark Nauwelaerts 2012-07-24 15:55:12 +02:00
parent 6cb106d690
commit 6cc2ad4744

View file

@ -4468,6 +4468,11 @@ gst_avi_demux_invert (GstAviStream * stream, GstBuffer * buf)
if (stream->strh->type != GST_RIFF_FCC_vids)
return buf;
if (stream->strf.vids == NULL) {
GST_WARNING ("Failed to retrieve vids for stream");
return buf;
}
fourcc = (stream->strf.vids->compression) ?
stream->strf.vids->compression : stream->strh->fcc_handler;
if (!gst_avi_demux_is_uncompressed (fourcc)) {
@ -4483,11 +4488,6 @@ gst_avi_demux_invert (GstAviStream * stream, GstBuffer * buf)
return buf;
}
if (stream->strf.vids == NULL) {
GST_WARNING ("Failed to retrieve vids for stream");
return buf;
}
h = stream->strf.vids->height;
w = stream->strf.vids->width;
stride = GST_ROUND_UP_4 (w * (bpp / 8));