image: Properly load images with a blank JPEGTables

Some SWFs, like sbemail205.swf (R.I.P.), have a blank JPEGTables.
In this case, we'll accidentally chop off the first two bytes of
the JPEG, which will cause it to fail to load. We shouldn't do that.
This fixes the loading issue with sbemail205.swf, but we don't draw
the bitmaps yet. We'll do that soon.
This commit is contained in:
Jasper St. Pierre 2012-11-18 22:43:23 -05:00 коммит произвёл Tobias Schneider
Родитель 5f30eb40ef
Коммит 1cf5a96090
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -18,7 +18,7 @@ function defineImage(tag, dictionary) {
if (tag.mimeType === 'image/jpeg') {
var width = 0;
var height = 0;
var i = 2;
var i = 0;
var n = imgData.length;
var code;
do {
@ -103,7 +103,7 @@ function defineImage(tag, dictionary) {
var header = tables.data;
data = header.substr(0, header.length - 2) + data;
} else {
data = '\xff\xd8' + data;
data = data;
}
} else {
var numChunks = imgData.length / 65536;