aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-05-08 16:57:34 -0700
committerAlon Zakai <alonzakai@gmail.com>2014-05-08 16:57:42 -0700
commit3aca411f788bf6db0e4eebacf4b8cf40076e11f6 (patch)
treee98a7356b50d5e04144b29a243e0af71fa07bace /src
parentcc8909ac35e7991b725db49d1f095af50be9fad0 (diff)
ignore touch events that do not correspond to a tracked touch; fixes BananaBread crashes
Diffstat (limited to 'src')
-rw-r--r--src/library_sdl.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/library_sdl.js b/src/library_sdl.js
index 077f72eb..d5b2b354 100644
--- a/src/library_sdl.js
+++ b/src/library_sdl.js
@@ -789,6 +789,7 @@ var LibrarySDL = {
}
case 'touchstart': case 'touchend': case 'touchmove': {
var touch = event.touch;
+ if (!Browser.touches[touch.identifier]) break;
var w = Module['canvas'].width;
var h = Module['canvas'].height;
var x = Browser.touches[touch.identifier].x / w;