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

Side by Side Diff: core/src/fpdftext/unicodenormalization.cpp

Issue 812843004: Fix an array size mismatch. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../include/fpdftext/fpdf_text.h" 7 #include "../../include/fpdftext/fpdf_text.h"
8 extern const FX_WCHAR g_UnicodeData_Normalization[65536]; 8 extern const FX_WCHAR g_UnicodeData_Normalization[65536];
9 extern const FX_WCHAR g_UnicodeData_Normalization_Map1[5376]; 9 extern const FX_WCHAR g_UnicodeData_Normalization_Map1[5376];
10 extern const FX_WCHAR g_UnicodeData_Normalization_Map2[1734]; 10 extern const FX_WCHAR g_UnicodeData_Normalization_Map2[1724];
11 extern const FX_WCHAR g_UnicodeData_Normalization_Map3[1164]; 11 extern const FX_WCHAR g_UnicodeData_Normalization_Map3[1164];
12 extern const FX_WCHAR g_UnicodeData_Normalization_Map4[488]; 12 extern const FX_WCHAR g_UnicodeData_Normalization_Map4[488];
13 FX_LPCWSTR g_UnicodeData_Normalization_Maps[5] = { 13 FX_LPCWSTR g_UnicodeData_Normalization_Maps[5] = {
14 NULL, 14 NULL,
15 g_UnicodeData_Normalization_Map1, 15 g_UnicodeData_Normalization_Map1,
16 g_UnicodeData_Normalization_Map2, 16 g_UnicodeData_Normalization_Map2,
17 g_UnicodeData_Normalization_Map3, 17 g_UnicodeData_Normalization_Map3,
18 g_UnicodeData_Normalization_Map4 18 g_UnicodeData_Normalization_Map4
19 }; 19 };
20 FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_LPWSTR pDst) 20 FX_STRSIZE FX_Unicode_GetNormalization(FX_WCHAR wch, FX_LPWSTR pDst)
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 { 66 {
67 FX_STRSIZE nLen = FX_WideString_GetNormalization(wsSrc, (FX_LPWSTR)NULL); 67 FX_STRSIZE nLen = FX_WideString_GetNormalization(wsSrc, (FX_LPWSTR)NULL);
68 if (!nLen) { 68 if (!nLen) {
69 return 0; 69 return 0;
70 } 70 }
71 FX_LPWSTR pBuf = wsDst.GetBuffer(nLen); 71 FX_LPWSTR pBuf = wsDst.GetBuffer(nLen);
72 FX_WideString_GetNormalization(wsSrc, pBuf); 72 FX_WideString_GetNormalization(wsSrc, pBuf);
73 wsDst.ReleaseBuffer(nLen); 73 wsDst.ReleaseBuffer(nLen);
74 return nLen; 74 return nLen;
75 } 75 }
OLDNEW
« 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