[brasero] One more safety test not to get a negative value for the position in the stream
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [brasero] One more safety test not to get a negative value for the position in the stream
- Date: Sun, 4 Oct 2009 12:20:17 +0000 (UTC)
commit 9f58acec014d2b78098e0829d975ecb2543dab66
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Mon Sep 28 14:50:26 2009 +0200
One more safety test not to get a negative value for the position in the stream
That will avoid an infinite loop in some rare cases.
libbrasero-utils/brasero-metadata.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/libbrasero-utils/brasero-metadata.c b/libbrasero-utils/brasero-metadata.c
index 1c81133..fb463f5 100644
--- a/libbrasero-utils/brasero-metadata.c
+++ b/libbrasero-utils/brasero-metadata.c
@@ -437,9 +437,12 @@ brasero_metadata_thumbnail (BraseroMetadata *self)
/* find the right position and move forward */
position = 15 * GST_SECOND;
- while (position >= priv->info->len)
+ while (position > 0 && position >= priv->info->len)
position -= 5 * GST_SECOND;
+ if (position <= 0)
+ return FALSE;
+
gst_element_set_state (priv->pipeline, GST_STATE_PAUSED);
priv->snapshot_started = 1;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]