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

Unified Diff: experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp

Issue 19625008: pdfviewer: more simple fixed to prevent crashes (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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
Index: experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp
===================================================================
--- experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp (revision 10286)
+++ experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp (working copy)
@@ -189,9 +189,9 @@
// TODO(edisonn): use null allocator, and let it just fail if memory
// needs allocated (but no crash)!
const unsigned char* current =
- nextObject(0, trailerStart, trailerEnd, &trailerKeyword, fAllocator, NULL);
+ nextObject(0, trailerStart, trailerEnd, &trailerKeyword, NULL, NULL);
- if (strlen("trailer") != trailerKeyword.len() &&
+ if (!trailerKeyword.isKeyword() || strlen("trailer") != trailerKeyword.len() ||
strncmp(trailerKeyword.c_str(), "trailer", strlen("trailer")) != 0) {
// TODO(edisonn): report warning, rebuild trailer from objects.
return -1;
« no previous file with comments | « experimental/PdfViewer/SkPdfRenderer.cpp ('k') | experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698