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

Submitted by:  Nutchanon Wetchasit <nachanon>
Submitted on:  Sun 13 Mar 2016 12:57:34 PM UTC  
 
Category: pluginPriority: 5 - Normal
Status: Ready For TestPrivacy: Public
Assigned to: Sandro Santilli <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>
Project MemberIn charge of this item.
Tue 29 Mar 2016 09:45:14 AM UTC, comment #2:

No automated tests for these patches ?

Sandro Santilli <strk>
Project MemberIn charge of this item.
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>

 

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
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by nachanon (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 29 Mar 2016 10:27:51 AM UTCstrkStatusNone=>Ready For Test
      Assigned toNone=>strk
    Sun 13 Mar 2016 12:59:59 PM UTCnachanonAttached File-=>Added 0002_plugin-externalinterface-number-marshall-enough-digits.patch, #36619
    Sun 13 Mar 2016 12:57:34 PM UTCnachanonAttached File-=>Added 0001_always-parse-externalinterface-number-as-double.patch, #36618

    Back to the top


    Powered by Savane 3.1-cleanup1