summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorHenrique Nakashima <hnakashima@chromium.org>2018-02-16 03:46:28 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-02-16 03:46:28 +0000
commit067a44fcad9196c6ad8cc3b2f86261b78ae54f48 (patch)
tree8e04bf7d5c20701fee0f688411edeea4b74caa47 /core
parent844d79e853074c99b7e5e64e051f1e1236c1723e (diff)
downloadpdfium-067a44fcad9196c6ad8cc3b2f86261b78ae54f48.tar.xz
Fix fallthroughs in XFA code.chromium/3350
Change-Id: I1fd4bf85cd709de1c14ed2895d045018f79bc61f Reviewed-on: https://pdfium-review.googlesource.com/26950 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'core')
-rw-r--r--core/fxcodec/bmp/cfx_bmpdecompressor.cpp2
-rw-r--r--core/fxcodec/codec/ccodec_pngmodule.cpp2
-rw-r--r--core/fxcrt/css/cfx_csssyntaxparser.cpp6
3 files changed, 10 insertions, 0 deletions
diff --git a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
index 0391258330..ea6e2ba0bb 100644
--- a/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
+++ b/core/fxcodec/bmp/cfx_bmpdecompressor.cpp
@@ -205,12 +205,14 @@ int32_t CFX_BmpDecompressor::ReadHeader() {
Error();
NOTREACHED();
}
+ break;
}
case 32:
break;
default:
Error();
NOTREACHED();
+ break;
}
src_row_bytes_ = BMP_WIDTHBYTES(width_, bit_counts_);
switch (bit_counts_) {
diff --git a/core/fxcodec/codec/ccodec_pngmodule.cpp b/core/fxcodec/codec/ccodec_pngmodule.cpp
index 37e83f7248..db5886aa29 100644
--- a/core/fxcodec/codec/ccodec_pngmodule.cpp
+++ b/core/fxcodec/codec/ccodec_pngmodule.cpp
@@ -10,6 +10,7 @@
#include "core/fxcodec/codec/codec_int.h"
#include "core/fxcodec/fx_codec.h"
+#include "core/fxcrt/fx_fallthrough.h"
#include "core/fxcrt/unowned_ptr.h"
#include "core/fxge/fx_dib.h"
#include "third_party/base/ptr_util.h"
@@ -155,6 +156,7 @@ static void _png_get_header_func(png_structp png_ptr, png_infop info_ptr) {
if (color_type1 != PNG_COLOR_TYPE_PALETTE) {
png_error(pContext->m_pPng, "Not Support Output Palette Now");
}
+ FX_FALLTHROUGH;
case PNG_COLOR_TYPE_RGB:
case PNG_COLOR_TYPE_RGB_ALPHA:
if (!(color_type1 & PNG_COLOR_MASK_COLOR)) {
diff --git a/core/fxcrt/css/cfx_csssyntaxparser.cpp b/core/fxcrt/css/cfx_csssyntaxparser.cpp
index b557bf090b..30352a5a20 100644
--- a/core/fxcrt/css/cfx_csssyntaxparser.cpp
+++ b/core/fxcrt/css/cfx_csssyntaxparser.cpp
@@ -12,6 +12,7 @@
#include "core/fxcrt/css/cfx_cssdeclaration.h"
#include "core/fxcrt/fx_codepage.h"
#include "core/fxcrt/fx_extension.h"
+#include "core/fxcrt/fx_fallthrough.h"
#include "third_party/base/logging.h"
namespace {
@@ -73,6 +74,7 @@ CFX_CSSSyntaxStatus CFX_CSSSyntaxParser::DoSyntaxParse() {
SwitchMode(CFX_CSSSyntaxMode::Comment);
break;
}
+ FX_FALLTHROUGH;
default:
if (wch <= ' ') {
m_TextPlane.MoveNext();
@@ -109,6 +111,7 @@ CFX_CSSSyntaxStatus CFX_CSSSyntaxParser::DoSyntaxParse() {
return CFX_CSSSyntaxStatus::Selector;
break;
}
+ FX_FALLTHROUGH;
default:
AppendChar(wch);
break;
@@ -133,6 +136,7 @@ CFX_CSSSyntaxStatus CFX_CSSSyntaxParser::DoSyntaxParse() {
return CFX_CSSSyntaxStatus::PropertyName;
break;
}
+ FX_FALLTHROUGH;
default:
AppendChar(wch);
break;
@@ -142,6 +146,7 @@ CFX_CSSSyntaxStatus CFX_CSSSyntaxParser::DoSyntaxParse() {
switch (wch) {
case ';':
m_TextPlane.MoveNext();
+ FX_FALLTHROUGH;
case '}':
SwitchMode(CFX_CSSSyntaxMode::PropertyName);
return CFX_CSSSyntaxStatus::PropertyValue;
@@ -151,6 +156,7 @@ CFX_CSSSyntaxStatus CFX_CSSSyntaxParser::DoSyntaxParse() {
return CFX_CSSSyntaxStatus::PropertyValue;
break;
}
+ FX_FALLTHROUGH;
default:
AppendChar(wch);
break;