(bug 31740) JpegMetadataExtractor and friends weren't checking for unexpected end...
authorBrian Wolff <bawolff@users.mediawiki.org>
Mon, 24 Oct 2011 02:19:11 +0000 (02:19 +0000)
committerBrian Wolff <bawolff@users.mediawiki.org>
Mon, 24 Oct 2011 02:19:11 +0000 (02:19 +0000)
commit8cbf9be869d7f20f11c11c9d9637a838d45331e8
tree6aee2ea4a2749d907c327d555f0e93347e0b4483
parentc864e13f050021a3ee544ae076eff7b54eb14395
(bug 31740) JpegMetadataExtractor and friends weren't checking for unexpected end of input properly

I created a new wrapper around unpack - wfUnpack which throws an exception if it runs out of input
(but i didn't use that on GIFMetadataExtractor/PNGMetadataExtractor because those files have a header saying that they weren't external dependencies minimized for potential re-users. I don't think anyone actually re-uses those files, but I didn't want to add a dependency on wfUnpack just in case).

I also changed fopen( blah, "r" ) -> fopen( blah, "rb" ) since these are binary formats, so we don't want newlines converted on windows.
includes/GlobalFunctions.php
includes/media/BMP.php
includes/media/GIFMetadataExtractor.php
includes/media/JpegMetadataExtractor.php
includes/media/PNGMetadataExtractor.php