[PATCH] fix for apple/trailers crash

Avi Rozen <[email protected]> Sat, 02 May 2009 21:04:57 +0300
Newsgroups gmane.comp.mozilla.mplayerplug-in
Message-ID <[email protected]>
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--===============5893674597681909511==
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="------------enig2563F8150E8F5F415011EF21"

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig2563F8150E8F5F415011EF21
Content-Type: multipart/mixed; boundary="------------060201040601060004040704"

This is a multi-part message in MIME format.
--------------060201040601060004040704
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi,

Since the beginning of last month I can't access any movie trailer on
apple.com - I get a segmentation fault as soon as the link to the .mov
file is accessed.

For reference: I'm running Debian/testing, Iceweasel 3.0.9 (unbranded
firefox), Debian packaged v 3.55  of mplayer plugin, and mplayer
1.0.rc2svn20090412 (packaged by debian-multimedia.org).

This seems to have already been reported as Ubuntu bug #360222 [1], and
Arch Linux bug #14155 [2].

I get the following typical output when running from a terminal:

ADDED URL: harrypotterhalfbloodprince-tlr4b_h640w.mov
code: 42
 speed -1

and then the segfault.

I used this text as a starting point for debugging and luck was on my
side :-)

The crash happens at plugin-list.cpp, line 414, during the call to
memmem. The cause is a typo in the exit condition at line 411 - 'p'
appears instead of 'buffer' (see attached patch), so that we get to line
414 even if there's no next "rmda" (consider lines  348, 418). All line
numbers refer to the code from the daily snapshot.

I'm guessing that something must have changed at apple.com to trigger
this specific code path. In any case, the patched plugin seems to work
nicely at my end.

Cheers,
Avi.

[1] https://bugs.launchpad.net/bugs/360222
[2] http://bugs.archlinux.org/task/14155


--------------060201040601060004040704
Content-Type: text/x-patch;
 name="apple-trailers-crash.patch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline;
 filename="apple-trailers-crash.patch"

Index: mplayerplug-in/Source/plugin-list.cpp
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- mplayerplug-in.orig/Source/plugin-list.cpp	2009-05-02 19:58:15.000000=
000 +0300
+++ mplayerplug-in/Source/plugin-list.cpp	2009-05-02 19:58:21.000000000 +=
0300
@@ -408,7 +408,7 @@
 			    code =3D 0;
 			}
 		    }
-		    if ((nextrmda - size) =3D=3D p)
+		    if ((nextrmda - size) =3D=3D buffer)
 			break;
 		    p =3D nextrmda + 4;
 		    nextrmda =3D

--------------060201040601060004040704--

--------------enig2563F8150E8F5F415011EF21
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkn8i08ACgkQwK8SobAxNVn0LwCg66LxX/70HTonuTrrk8sSY70P
jCQAoKb+zqRPqQQZwyrDPiWeQ5vWoJzg
=I90H
-----END PGP SIGNATURE-----

--------------enig2563F8150E8F5F415011EF21--


--===============5893674597681909511==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
--===============5893674597681909511==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Mplayerplug-in-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mplayerplug-in-devel

--===============5893674597681909511==--