patchGnash - The GNU Flash player - Patches: patch #8942, Patches to improve number value...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #8942: Patches to improve number value handling in ExternalInterface

Submitter:  Nutchanon Wetchasit <nachanon>
Submitted:  Sun 13 Mar 2016 12:57:34 PM UTC
   
 
Category:  plugin Priority:  5 - Normal
Status:  Ready For Test Privacy:  Public
Assigned to:  strk Open/Closed:  Open

Tue 29 Mar 2016 10:27:51 AM UTC, comment #3: 

Patch1 pushed as 2f264a33249e4cfe03ff728ba2f54c6ee2b96d74
Patch2 pushed as c98c271596356118b074a4023c7816623a5514ab

Sandro Santilli <strk>
Group Member
Tue 29 Mar 2016 09:45:14 AM UTC, comment #2: 

No automated tests for these patches ?

Sandro Santilli <strk>
Group Member
Sun 13 Mar 2016 12:59:59 PM UTC, comment #1: 

Current libgnashplugin marshall `double` value sent from NPRuntime
to `<number>` data using default iostream with no specific precision
specified. This causes precision loss as not enough decimal digits
were used to represent the value.

Patch 2 of 2:
See the attached `0002_plugin-externalinterface-number-marshall-enough-digits.patch`.

This patch explicitly specifies iostream floating point precision to
`std::numeric_limits<double>::max_digits10` (C++ 11) which is
enough significands to accurately reproduce the original `double` value
(provided that receiver end's parser library implements the correct rounding).

This partially fixes bug #47280.

Gnash: 0.8.11dev (patched against git a72afa5 9-Mar-2016) NPAPI
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386


(file #36619)

Nutchanon Wetchasit <nachanon>
Sun 13 Mar 2016 12:57:34 PM UTC, original submission:  

Current libgnashplugin's ExternalInterface data parser has
a problem unmarshalling `Number` value sent from Gnash (player) when
the number is a very large whole number, or is a special float value like
`Infinity`, `-Infinity`, and `NaN`. This is due to the parser selectively
parse number string without dot as integer (range `int32_t`).

Patch 1 of 2:
See the attached `0001_always-parse-externalinterface-number-as-double.patch`.

This patch makes libgnashplugin always unmarshall `<number>` value sent
from Gnash player as `double`, which supports special value like infinity
and non-number value. This also make a large whole number correctly passed
as wider significand range is provided (53-bit instead of 32-bit).

This partially fixes bug #47280.

The change in type shouldn't cause problem, as `ExternalInterface::parseXML()`
is only used for parsing return value for JavaScript-access call
(ExternalInterface and built-in Flash plugin functions).

Gnash: 0.8.11dev (patched against git a72afa5 9-Mar-2016) NPAPI
Browser: Iceweasel 10.0.12 (debian)
System: Debian GNU/Linux 7.0 Wheezy i386

Nutchanon Wetchasit <nachanon>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #36619:  0002_plugin-externalinterface-number-marshall-enough-digits.patch added by nachanon (809B - text/x-diff - Patch to make libgnashplugin use enough decimal digits in `<number>` to represent `double`)
file #36618:  0001_always-parse-externalinterface-number-as-double.patch added by nachanon (1KiB - text/x-diff - Patch to make libgnashplugin always parse `<number>` as `double`)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by strk (Posted a comment)
  • -email is unavailable- added by nachanon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-29 strk StatusNone Ready For Test
        Assigned toNone strk
    2016-03-13 nachanon Attached File- Added 0002_plugin-externalinterface-number-marshall-enough-digits.patch, #36619
    2016-03-13 nachanon Attached File- Added 0001_always-parse-externalinterface-number-as-double.patch, #36618

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code