mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-25 01:30:38 +00:00
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:
parent
8588ebd22a
commit
1fec709792
1 changed files with 9 additions and 2 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue