summaryrefslogtreecommitdiffstats
path: root/gst/avi
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2009-02-25 12:05:22 +0100
committerWim Taymans <wim.taymans@collabora.co.uk>2009-02-25 12:05:22 +0100
commit1fec7097926395c0a49f1e714b086129edc8ab09 (patch)
treee084af86797f3ad0736277c9c6bdb5adfe61e480 /gst/avi
parent8588ebd22a07c5f994b3410db6e73676b38550fd (diff)
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.
Diffstat (limited to 'gst/avi')
-rw-r--r--gst/avi/gstavidemux.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c
index 2473b922..017a7f58 100644
--- a/gst/avi/gstavidemux.c
+++ b/gst/avi/gstavidemux.c
@@ -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)) {