From e93f784ee11b5b57612cd89a0443fab47a4a6590 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 12 May 2009 21:20:04 +0200 Subject: [PATCH] avidemux: Fix pointer arithmetic This fixes a seeking regression, bug #134522. --- gst/avi/gstavidemux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 70f677772f..62a8f4a99c 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -351,7 +351,7 @@ gst_avi_demux_index_entry_for_time (GstAviDemux * avi, gint stream_nr, guint64 time) { gst_avi_index_entry *entry = NULL; - guint n = 0; + guint n; GST_LOG_OBJECT (avi, "stream_nr:%d , time:%" GST_TIME_FORMAT, stream_nr, GST_TIME_ARGS (time)); @@ -362,6 +362,7 @@ gst_avi_demux_index_entry_for_time (GstAviDemux * avi, (GCompareDataFunc) gst_avi_demux_index_entry_search, GST_SEARCH_MODE_BEFORE, &time, NULL); + n = entry - avi->index_entries; if (entry == NULL) { entry = &avi->index_entries[0]; n = 0; @@ -370,7 +371,6 @@ gst_avi_demux_index_entry_for_time (GstAviDemux * avi, entry = &avi->index_entries[n]; } } else if (entry->stream_nr != stream_nr) { - n = (entry - avi->index_entries) / sizeof (gst_avi_index_entry); while (entry->stream_nr != stream_nr && n > 0) { n--; entry = &avi->index_entries[n];