From: Wim Taymans Date: Tue, 26 Apr 2005 18:07:45 +0000 (+0000) Subject: gst/gsttrashstack.h: Ooohh. a nasty one! After having a failed pop() from the stack... X-Git-Tag: RELEASE-0_9_2~537 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d68914ad648f25361f4880fa0d00a0fba3958209;p=platform%2Fupstream%2Fgstreamer.git 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. --- diff --git a/ChangeLog b/ChangeLog index faf36b4..f80ba3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-04-26 Wim Taymans + + * 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-25 Wim Taymans * gst/gstpad.c: (gst_pad_set_active), (gst_pad_peer_set_active), diff --git a/gst/gsttrashstack.h b/gst/gsttrashstack.h index 9c66499..bd67e61 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)