Chromium Code Reviews| Index: base/i18n/icu_encoding_detection.cc |
| diff --git a/base/i18n/icu_encoding_detection.cc b/base/i18n/icu_encoding_detection.cc |
| index 3583fa9c5f7436ef02b61e177bc433b488fdc0e6..ce7a372fe13710a36650203765a5439249213c02 100644 |
| --- a/base/i18n/icu_encoding_detection.cc |
| +++ b/base/i18n/icu_encoding_detection.cc |
| @@ -22,6 +22,10 @@ bool DetectEncoding(const std::string& text, std::string* encoding) { |
| ucsdet_setText(detector, text.data(), static_cast<int32_t>(text.length()), |
| &status); |
| const UCharsetMatch* match = ucsdet_detect(detector, &status); |
| + // In case that ucsdet_detect() returns NULL with no error |
| + // http://crosbug.com/15691 |
|
zel
2011/05/24 22:46:48
Please remove this comment, no need for that.
|
| + if (match == NULL) |
| + return false; |
| const char* detected_encoding = ucsdet_getName(match, &status); |
| ucsdet_close(detector); |