Avoid a crash in avi with subtitles by only dereferencing the video description
when we actually are dealing with video in the _invert function.
gst_avi_demux_invert (avi_stream_context * stream, GstBuffer * buf)
{
GstStructure *s;
- gint y, h = stream->strf.vids->height;
+ gint y, w, h;
gint bpp, stride;
guint8 *tmp = NULL;
return buf;
}
- stride = stream->strf.vids->width * (bpp / 8);
+ 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 = w * (bpp / 8);
buf = gst_buffer_make_writable (buf);
if (GST_BUFFER_SIZE (buf) < (stride * h)) {