Re: More defensive version of nsScriptablePeer::GetPlayState

Kevin DeKorte <[email protected]> Tue, 09 Oct 2007 16:20:53 -0600
Newsgroups gmane.comp.mozilla.mplayerplug-in
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jari Korhonen wrote:
> Hello,
> 
> Included html file (clown_hermanni.htm) with link to Finnish
> Broadcasting Co so-called "elävä arkisto" (living archive) seems to
> rather reliably crash mplayerplug-in (daily build 5th Oct, 2007) in
> function nsScriptablePeer::GetPlayState()
> 
> After some debugging, I found out that the it crashes because (for some
> reason or other) variable mPlugin can be NULL when this function is called.
> 
> I changed function to be a little bit more defensive:
> 
> NS_IMETHODIMP nsScriptablePeer::GetPlayState(PRInt32 * aPlayState)
> {
>    printf("JS playState issued\n");
>    assert (aPlayState != NULL);
>      //Apparently, mPlugin CAN be NULL here for some reason (external
> bug ?).
>    //Try to avoid crash if so
>    if (mPlugin != NULL)
>        mPlugin->GetPlayState(aPlayState);
>    else
>    *aPlayState = JS_STATE_UNDEFINED;
>      return NS_OK;
> }
> 
> with this change, "elävä arkisto" seems to work ok now.
> 
> Cheers,
> 
> Jari

Jari,

Patch committed, but could you send me the actual website to test with?
Since the page you included didn't work.

Kevin
- --
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHC/7F6w2kMH0L1dERAtw4AJ9fsYWJBxvYB3zJ7+hMKhrMrhFtuQCcCyUz
hLni6DwLFFGABOKxmnnVhMs=
=ceUx
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/