Commit d2b00489 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fix for null pointer dereference & data abort on swapping to no toolsprites

This specific case failed when the topmost window in the window stack (ie. the first to be attempted to be redrawn on reentering the desktop) had the focus and thus attempts to enable Ursula tinting.
Though a check was made to see if the first sprite (from which the tint is derived) was present, no check was made to see if the tool_list was present => dereferenced NULL pointer.
Retagged as Wimp-5_29.
parent c6697ab1
......@@ -8841,8 +8841,9 @@ no_thin_outline
;
forcetint_on EntryS "R0,R2"
LDR R2, tool_list
LDR R2, [R2]
TEQ R2, #0 ; don't bother if there aren't any tools
TEQ R2, #0
LDRNE R2, [R2, #tool_back]
TEQNE R2, #0 ; don't bother if there aren't any tools
EXITS EQ
LDRB R0, tinted_window
......@@ -8858,8 +8859,9 @@ forcetint_on EntryS "R0,R2"
;
forcetint_off EntryS "R2"
LDR R2, tool_list
LDR R2, [R2]
TEQ R2, #0 ; don't bother if there aren't any tools
TEQ R2, #0
LDRNE R2, [R2, #tool_back]
TEQNE R2, #0 ; don't bother if there aren't any tools
EXITS EQ
LDRB R14, tinted_tool
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment