avidemux: avoid crashing on subtitles

Avoid a crash in avi with subtitles by only dereferencing the video description
when we actually are dealing with video in the _invert function.
This commit is contained in:
Wim Taymans 2009-02-25 12:05:22 +01:00
parent 8588ebd22a
commit 1fec709792

View file

@ -3599,7 +3599,7 @@ static GstBuffer *
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;
@ -3616,7 +3616,14 @@ gst_avi_demux_invert (avi_stream_context * stream, GstBuffer * buf)
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)) {