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

Unified Diff: src/images/SkImageDecoder_libjpeg.cpp

Issue 24461002: Print a better error message. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/images/SkImageDecoder_libjpeg.cpp
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp
index d50e4eb015689335b3910c97f58104bb41dc14c7..107441b3cbbc831317bf9c27cdad70e49baac511 100644
--- a/src/images/SkImageDecoder_libjpeg.cpp
+++ b/src/images/SkImageDecoder_libjpeg.cpp
@@ -285,11 +285,12 @@ static bool skip_src_rows_tile(jpeg_decompress_struct* cinfo,
// This guy exists just to aid in debugging, as it allows debuggers to just
// set a break-point in one place to see all error exists.
static bool return_false(const jpeg_decompress_struct& cinfo,
- const SkBitmap& bm, const char msg[]) {
+ const SkBitmap& bm, const char caller[]) {
#ifdef SK_DEBUG
+ char buffer[JMSG_LENGTH_MAX];
+ cinfo.err->format_message((const j_common_ptr)&cinfo, buffer);
SkDebugf("libjpeg error %d <%s> from %s [%d %d]\n", cinfo.err->msg_code,
- cinfo.err->jpeg_message_table[cinfo.err->msg_code], msg,
- bm.width(), bm.height());
+ buffer, caller, bm.width(), bm.height());
#endif
return false; // must always return false
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698