Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(862)

Unified Diff: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp

Issue 2482883002: Fail to decode jpegs on a large number of progressive scans (Closed)
Patch Set: Add unit test Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
index db35162328d60184776e5b5dd62b9202428afc00..aba6aadee56b5443b197e0549ac9da8e8bafe3a6 100644
--- a/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/jpeg/JPEGImageDecoderTest.cpp
@@ -299,4 +299,18 @@ TEST(JPEGImageDecoderTest, mergeBuffer) {
testMergeBuffer(&createDecoder, jpegFile);
}
+// This tests decoding a JPEG with many progressive scans. Decoding should
msarett 2016/11/07 15:42:28 This test takes about 16ms to run.
+// fail, but not hang (crbug.com/642462).
+TEST(JPEGImageDecoderTest, manyProgressiveScans) {
+ RefPtr<SharedBuffer> testData =
+ readFile(decodersTestingDir, "many-progressive-scans.jpg");
+ ASSERT_TRUE(testData.get());
+
+ std::unique_ptr<ImageDecoder> testDecoder = createDecoder();
+ testDecoder->setData(testData.get(), true);
+ EXPECT_EQ(1u, testDecoder->frameCount());
+ ASSERT_TRUE(testDecoder->frameBufferAtIndex(0));
+ EXPECT_TRUE(testDecoder->failed());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698