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

Side by Side Diff: testing/libfuzzer/pdf_codec_jbig2_fuzzer.cc

Issue 2471253004: Fix roll after TRUE conversion (Closed)
Patch Set: Created 4 years, 1 month 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 2016 The PDFium Authors. All rights reserved. 1 // Copyright 2016 The 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 #include <cstdint> 5 #include <cstdint>
6 6
7 #include "core/fpdfapi/parser/cpdf_stream.h" 7 #include "core/fpdfapi/parser/cpdf_stream.h"
8 #include "core/fpdfapi/parser/cpdf_stream_acc.h" 8 #include "core/fpdfapi/parser/cpdf_stream_acc.h"
9 #include "core/fxcodec/JBig2_DocumentContext.h" 9 #include "core/fxcodec/JBig2_DocumentContext.h"
10 #include "core/fxcodec/codec/ccodec_jbig2module.h" 10 #include "core/fxcodec/codec/ccodec_jbig2module.h"
(...skipping 15 matching lines...) Expand all
26 data += kParameterSize; 26 data += kParameterSize;
27 27
28 std::unique_ptr<CFX_DIBitmap> bitmap(new CFX_DIBitmap); 28 std::unique_ptr<CFX_DIBitmap> bitmap(new CFX_DIBitmap);
29 if (!bitmap->Create(width, height, FXDIB_1bppRgb)) 29 if (!bitmap->Create(width, height, FXDIB_1bppRgb))
30 return 0; 30 return 0;
31 31
32 std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> stream( 32 std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> stream(
33 new CPDF_Stream); 33 new CPDF_Stream);
34 stream->AsStream()->SetData(data, size); 34 stream->AsStream()->SetData(data, size);
35 CPDF_StreamAcc src_stream; 35 CPDF_StreamAcc src_stream;
36 src_stream.LoadAllData(stream->AsStream(), TRUE); 36 src_stream.LoadAllData(stream->AsStream(), true);
37 37
38 CCodec_Jbig2Module module; 38 CCodec_Jbig2Module module;
39 CCodec_Jbig2Context jbig2_context; 39 CCodec_Jbig2Context jbig2_context;
40 std::unique_ptr<JBig2_DocumentContext> document_context; 40 std::unique_ptr<JBig2_DocumentContext> document_context;
41 FXCODEC_STATUS status = module.StartDecode( 41 FXCODEC_STATUS status = module.StartDecode(
42 &jbig2_context, &document_context, width, height, &src_stream, nullptr, 42 &jbig2_context, &document_context, width, height, &src_stream, nullptr,
43 bitmap->GetBuffer(), bitmap->GetPitch(), nullptr); 43 bitmap->GetBuffer(), bitmap->GetPitch(), nullptr);
44 44
45 while (status == FXCODEC_STATUS_DECODE_TOBECONTINUE) 45 while (status == FXCODEC_STATUS_DECODE_TOBECONTINUE)
46 status = module.ContinueDecode(&jbig2_context, nullptr); 46 status = module.ContinueDecode(&jbig2_context, nullptr);
47 return 0; 47 return 0;
48 } 48 }
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