From a1d0655f73773a0058f692ff0651037f785e8865 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Tue, 13 Jun 2006 09:54:26 +0000 Subject: [PATCH] gst/avi/gstavidemux.c: Prevent out of bounds array access when scrubbing towards the end of the file between the last... Original commit message from CVS: * gst/avi/gstavidemux.c: (gst_avi_demux_handle_seek): Prevent out of bounds array access when scrubbing towards the end of the file between the last index entry and the end. Fixes occasional 'start <= stop' newsegment event assertions when scrubbing in MJPEG files. --- ChangeLog | 8 ++++++++ gst/avi/gstavidemux.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2991b51..0973ad8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2006-06-13 Tim-Philipp Müller + + * gst/avi/gstavidemux.c: (gst_avi_demux_handle_seek): + Prevent out of bounds array access when scrubbing towards + the end of the file between the last index entry and the + end. Fixes occasional 'start <= stop' newsegment event + assertions when scrubbing in MJPEG files. + 2006-06-12 Tim-Philipp Müller * tests/check/elements/.cvsignore: diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 5d26eac..392ce79 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -2372,6 +2372,8 @@ gst_avi_demux_handle_seek (GstAviDemux * avi, gboolean update) GST_WARNING_OBJECT (avi, "Couldn't find AviIndexEntry for time:%" GST_TIME_FORMAT, GST_TIME_ARGS (avi->segment.start)); + if (avi->current_entry >= avi->index_size && avi->index_size > 0) + avi->current_entry = avi->index_size - 1; } } -- 2.7.4