Backed out changeset 9e5254e7728e (bug 1823614) for causing reftest failures on pattern-transformed. CLOSED TREE

This commit is contained in:
Iulian Moraru 2023-03-25 05:23:27 +02:00
Родитель 9ce9208392
Коммит 0b75230e48
6 изменённых файлов: 0 добавлений и 22 удалений

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

@ -67,7 +67,6 @@ METHODDEF(boolean) fill_input_buffer(j_decompress_ptr jd);
METHODDEF(void) skip_input_data(j_decompress_ptr jd, long num_bytes);
METHODDEF(void) term_source(j_decompress_ptr jd);
METHODDEF(void) my_error_exit(j_common_ptr cinfo);
METHODDEF(void) progress_monitor(j_common_ptr info);
// Normal JFIF markers can't have more bytes than this.
#define MAX_JPEG_MARKER_LENGTH (((uint32_t)1 << 16) - 1)
@ -102,7 +101,6 @@ nsJPEGDecoder::nsJPEGDecoder(RasterImage* aImage,
mBytesToSkip = 0;
memset(&mInfo, 0, sizeof(jpeg_decompress_struct));
memset(&mSourceMgr, 0, sizeof(mSourceMgr));
memset(&mProgressMgr, 0, sizeof(mProgressMgr));
mInfo.client_data = (void*)this;
mSegment = nullptr;
@ -162,9 +160,6 @@ nsresult nsJPEGDecoder::InitInternal() {
mInfo.mem->max_memory_to_use = static_cast<long>(
std::min<size_t>(SurfaceCache::MaximumCapacity(), LONG_MAX));
mProgressMgr.progress_monitor = &progress_monitor;
mInfo.progress = &mProgressMgr;
// Record app markers for ICC data
for (uint32_t m = 0; m < 16; m++) {
jpeg_save_markers(&mInfo, JPEG_APP0 + m, 0xFFFF);
@ -739,17 +734,6 @@ my_error_exit(j_common_ptr cinfo) {
longjmp(err->setjmp_buffer, static_cast<int>(error_code));
}
static void progress_monitor(j_common_ptr info) {
int scan = ((j_decompress_ptr)info)->input_scan_number;
// Progressive images with a very large number of scans can cause the decoder
// to hang. Here we use the progress monitor to abort on a very large number
// of scans. 1000 is arbitrary, but much larger than the number of scans we
// might expect in a normal image.
if (scan >= 1000) {
my_error_exit(info);
}
}
/*******************************************************************************
* This is the callback routine from the IJG JPEG library used to supply new
* data to the decompressor when its input buffer is exhausted. It juggles

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

@ -82,7 +82,6 @@ class nsJPEGDecoder : public Decoder {
public:
struct jpeg_decompress_struct mInfo;
struct jpeg_source_mgr mSourceMgr;
struct jpeg_progress_mgr mProgressMgr;
decoder_error_mgr mErr;
jstate mState;

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

@ -1 +0,0 @@
<img src="nosuchurl">

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

@ -1 +0,0 @@
<img src="jpg-progressive-1000.jpg">

Двоичные данные
image/test/reftest/jpeg/jpg-progressive-1000.jpg

Двоичный файл не отображается.

До

Ширина:  |  Высота:  |  Размер: 34 KiB

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

@ -68,6 +68,3 @@ HTTP == webcam-simulacrum.html blue.html
== non-interleaved_progressive-2.jpg non-interleaved_progressive-2-white-ref.png
== red-bad-marker.jpg red.jpg
# check that we reject jpegs with > 1000 scans
== jpg-progressive-1000.html jpg-progressive-1000-ref.html