diff options
author | 2013-09-25 21:27:31 +0000 | |
---|---|---|
committer | 2013-09-25 21:27:31 +0000 | |
commit | 228f2b8887ab63532cbe0b7b64e66c133f45d45a (patch) | |
tree | e1f64d6117afb465017fbacbe1bb0ab20a8a72b7 | |
parent | a93489986789bdf109064884bb940ced71110349 (diff) |
Print a better error message.
Use format_message to print the proper error message in JPEG decoder.
R=mtklein@google.com
Review URL: https://codereview.chromium.org/24461002
git-svn-id: http://skia.googlecode.com/svn/trunk@11459 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/images/SkImageDecoder_libjpeg.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/images/SkImageDecoder_libjpeg.cpp b/src/images/SkImageDecoder_libjpeg.cpp index d50e4eb015..107441b3cb 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 } |