summaryrefslogtreecommitdiff
path: root/src/jpeg/jpeg_scanner.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/jpeg/jpeg_scanner.cc')
-rw-r--r--src/jpeg/jpeg_scanner.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/jpeg/jpeg_scanner.cc b/src/jpeg/jpeg_scanner.cc
index 85426b2..c039f70 100644
--- a/src/jpeg/jpeg_scanner.cc
+++ b/src/jpeg/jpeg_scanner.cc
@@ -93,10 +93,12 @@ ValidatedByte JpegScanner::GetValidatedByte(size_t location) {
if (next_segment_ && next_segment_->Contains(location)) {
return next_segment_->GetValidatedByte(location);
}
- stringstream sstream;
- sstream << location;
- MessageHandler::Get()->ReportMessage(Message::kPrematureEndOfDataError,
- sstream.str());
+ if (message_handler_) {
+ stringstream sstream;
+ sstream << location;
+ message_handler_->ReportMessage(Message::kPrematureEndOfDataError,
+ sstream.str());
+ }
return InvalidByte();
}