Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2300)

Unified Diff: core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

Issue 1877033003: Prevent an OOB access in CPDF_DIBSource::TranslateScanline24bpp (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
diff --git a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 7b88e84399d90b15cb81cdda1e1f283bc91aa753..052d1d5b52ae4f4d070c8501d89ad358f6c9843c 100644
--- a/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -917,7 +917,8 @@ void CPDF_DIBSource::TranslateScanline24bpp(uint8_t* dest_scan,
}
unsigned int max_data = (1 << m_bpc) - 1;
if (m_bDefaultDecode) {
- if (m_Family == PDFCS_DEVICERGB || m_Family == PDFCS_CALRGB) {
+ if ((m_Family == PDFCS_DEVICERGB || m_Family == PDFCS_CALRGB) &&
+ m_nComponents == 3) {
Tom Sepez 2016/04/12 00:39:27 Do we just want to return in error if m_nComponent
Oliver Chang 2016/04/12 00:48:59 I'm not sure if we get good output, but it doesn't
Oliver Chang 2016/04/12 16:36:22 Done.
const uint8_t* src_pos = src_scan;
switch (m_bpc) {
case 16:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698