[PATCH] Segfault patch for state.c
Emmanuel Saracco <[email protected]>
| Newsgroups | gmane.comp.audio.jamin.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi all, Here is a tiny patch to fix segfault on very first history redo when no action has been done. To reproduce segfault: 1/ Launch JAMin 2/ CTRL-R (or menu/edit/redo) Bye ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Jamin-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/jamin-devel
state.c.patch
(text/x-patch, 508 B)
--- state.c-orig 2007-10-06 20:30:38.000000000 +0200
+++ state.c 2007-10-06 20:30:27.000000000 +0200
@@ -395,12 +395,13 @@
undo_pos = g_list_next(undo_pos);
restore = TRUE;
}
- } else {
- undo_pos = history;
- undo_pos = g_list_next(undo_pos);
- restore = TRUE;
+ } else if (history->next) {
+ undo_pos = history;
+ undo_pos = g_list_next(undo_pos);
+ restore = TRUE;
}
+
if (restore)
{
s_restore_state((s_state *)undo_pos->data);