chromium/octane

GB Emulator crashes when changing settings for canvas scaling

GoogleCodeExporter opened this issue · 0 comments

What steps will reproduce the problem?
1. Modify line 9373 of gbemu-part2.js so that the setting for "Scale the canvas 
in JS, or let the browser scale the canvas?" is "true".
2. Run the benchmark.

What is the expected output? What do you see instead?
The benchmark page shows "Error" for GB Emulator and the Octane score is marked 
as incomplete. On the console, you get:
Gameboy: HTML5 Canvas support required: this.drawContextOffscreen.getImageData 
is not a functionfile: gbemu-part2.js, line: 5031
Gameboy: Error

What version of the product are you using? On what operating system?
Firefox 29

Please provide any additional information below.
The root cause of the problem is that lines 9753 and 9754 read undefined 
values. With the default settings of gbemu, these values are ignored and 
replaced by default values in lines 5005 and 5006 of gbemu-part2.js. With the 
changed settings, however, the values propagate to line 77 of gbemu-part1.js 
and cause an exception, because NaN is passed to Uint8Array. Even worse, the 
exception is caught in line 5030 of gbemu-part2.js and the error handling code 
calls an undefined function. This call leads to another exception, which is not 
caught and causes the benchmark to crash.

Original issue reported on code.google.com by mich...@binaervarianz.de on 27 May 2014 at 6:04