diff options
Diffstat (limited to 'debugger/QT/SkDebuggerGUI.cpp')
-rw-r--r-- | debugger/QT/SkDebuggerGUI.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/debugger/QT/SkDebuggerGUI.cpp b/debugger/QT/SkDebuggerGUI.cpp index 890c607bb8..a823c19f90 100644 --- a/debugger/QT/SkDebuggerGUI.cpp +++ b/debugger/QT/SkDebuggerGUI.cpp @@ -1001,7 +1001,16 @@ void SkDebuggerGUI::loadPicture(const SkString& fileName) { fFileName = fileName; fLoading = true; SkStream* stream = SkNEW_ARGS(SkFILEStream, (fileName.c_str())); - SkOffsetPicture* picture = SkNEW_ARGS(SkOffsetPicture, (stream, NULL, &SkImageDecoder::DecodeStream)); + + bool success = false; + + SkOffsetPicture* picture = SkNEW_ARGS(SkOffsetPicture, (stream, &success, &SkImageDecoder::DecodeStream)); + + if (!success) { + QMessageBox::critical(this, "Error loading file", "Couldn't read file, sorry."); + SkSafeUnref(stream); + return; + } fCanvasWidget.resetWidgetTransform(); fDebugger.loadPicture(picture); |