summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@gmail.com>2005-04-26 18:11:21 +0000
committerWim Taymans <wim.taymans@gmail.com>2005-04-26 18:11:21 +0000
commit3670c2f9dc3859d35d5c7d14f526c71bfe19d456 (patch)
tree8050da445bd26e49826327bbbd13110c992aa107
parent26d06184a326af2c331ae3c437624ac913ddd8e2 (diff)
downloadgstreamer-3670c2f9dc3859d35d5c7d14f526c71bfe19d456.tar.gz
gst/gsttrashstack.h: Ooohh. a nasty one! After having a failed pop() from the stack, it's possible that the stack is ...
Original commit message from CVS: * gst/gsttrashstack.h: Ooohh. a nasty one! After having a failed pop() from the stack, it's possible that the stack is empty. In that case, don't follow the NULL pointer.
-rw-r--r--ChangeLog7
-rw-r--r--gst/gsttrashstack.h4
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 91ddb52022..89a726d8d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-04-26 Wim Taymans <wim@fluendo.com>
+
+ * gst/gsttrashstack.h:
+ Ooohh. a nasty one! After having a failed pop() from the stack,
+ it's possible that the stack is empty. In that case, don't
+ follow the NULL pointer.
+
2005-04-26 Benjamin Otte <in7y118@public.uni-hamburg.de>
* gst/gstelementfactory.c: (gst_element_factory_create):
diff --git a/gst/gsttrashstack.h b/gst/gsttrashstack.h
index 92fcf373a0..cc670587d7 100644
--- a/gst/gsttrashstack.h
+++ b/gst/gsttrashstack.h
@@ -110,7 +110,9 @@ gst_trash_stack_pop (GstTrashStack *stack)
" incl %%ecx; \n\t" /* and increment */
SMP_LOCK "cmpxchg8b %1; \n\t" /* if eax:edx == *stack, move ebx:ecx to *stack,
* else *stack is moved into eax:edx again... */
- " jnz 10b; \n\t" /* ... and we retry */
+ " jz 20f; \n\t" /* success */
+ " testl %%eax, %%eax; \n\t" /* if (head == NULL) return */
+ " jnz 10b; \n\t" /* else we retry */
"20: \n\t"
" popl %%ebx \n"
: "=a" (head)