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

Unified Diff: tools/test_image_decoder.cpp

Issue 24449003: Make Jpeg decoding more fault resistant. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: final rebase Created 7 years, 2 months 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
« no previous file with comments | « tools/find_bad_images_in_skps.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/test_image_decoder.cpp
diff --git a/tools/test_image_decoder.cpp b/tools/test_image_decoder.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..2ba89aaee3c0d1dbbfbd8bae76fd2627d7ad902b
--- /dev/null
+++ b/tools/test_image_decoder.cpp
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2013 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "SkBitmap.h"
+#include "SkForceLinking.h"
+#include "SkGraphics.h"
+#include "SkImageDecoder.h"
+
+__SK_FORCE_IMAGE_DECODER_LINKING;
+
+/**
+ Simple program to test Skia's ability to decode images without
+ errors or debug messages. */
+int main(int argc, char ** argv) {
+ if (argc < 2) {
+ SkDebugf("Usage:\n %s imagefile\n\n", argv[0]);
+ return 3;
+ }
+ SkBitmap bitmap;
+ if (!(SkImageDecoder::DecodeFile(argv[1], &bitmap))) {
+ return 2;
+ }
+ if (bitmap.empty()) {
+ return 1;
+ }
+ return 0;
+}
+
« no previous file with comments | « tools/find_bad_images_in_skps.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698