linmaogithub / pdfium

Automatically exported from code.google.com/p/pdfium
0 stars 0 forks source link

Leak in FlateUncompress() #212

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The sample PDF from https://code.google.com/p/chromium/issues/detail?id=535734 
and a couple of others end up causing a small leak.

334 bytes in 1 blocks are definitely lost in loss record 35 of 38
   at 0x4C2D68D: calloc (vg_replace_malloc.c:592)
   by 0x45951C: FX_AllocOrDie(unsigned long, unsigned long) (fx_memory.h:37)
   by 0x481345: (anonymous namespace)::FlateUncompress(unsigned char const*, unsigned int, unsigned int, unsigned char*&, unsigned int&, unsigned int&) (fx_codec_flate.cpp:643)
   by 0x480C5B: CCodec_FlateModule::FlateOrLZWDecode(int, unsigned char const*, unsigned int, int, int, int, int, int, unsigned int, unsigned char*&, unsigned int&) (fx_codec_flate.cpp:943)
   by 0x5D3BAC: FPDFAPI_FlateOrLZWDecode(int, unsigned char const*, unsigned int, CPDF_Dictionary*, unsigned int, unsigned char*&, unsigned int&) (fpdf_parser_decode.cpp:319)
   by 0x5CE9F4: PDF_DecodeInlineStream(unsigned char const*, unsigned int, int, int, CFX_ByteString&, CPDF_Dictionary*, unsigned char*&, unsigned int&) (fpdf_page_parser_old.cpp:301)
   by 0x5CDD6E: CPDF_StreamParser::ReadInlineStream(CPDF_Document*, CPDF_Dictionary*, CPDF_Object*, int) (fpdf_page_parser_old.cpp:397)
   by 0x5CD0BF: CPDF_StreamContentParser::Handle_BeginImage() (fpdf_page_parser_old.cpp:103)
   by 0x5C9483: CPDF_StreamContentParser::OnOperator(char const*) (fpdf_page_parser.cpp:367)
   by 0x5CC659: CPDF_StreamContentParser::Parse(unsigned char const*, unsigned int, unsigned int) (fpdf_page_parser_old.cpp:44)
   by 0x5D091E: CPDF_ContentParser::Continue(IFX_Pause*) (fpdf_page_parser_old.cpp:1101)
   by 0x5A7038: CPDF_PageObjects::ContinueParse(IFX_Pause*) (fpdf_page.cpp:693)
   by 0x5A7C44: CPDF_Page::ParseContent(CPDF_ParseOptions*, int) (fpdf_page.cpp:874)
   by 0x447BD4: FPDF_LoadPage (fpdfview.cpp:308)
   by 0x409763: RenderPdf(std::string const&, char const*, unsigned long, Options const&) (pdfium_test.cc:506)
   by 0x40A324: main (pdfium_test.cc:647)

Original issue reported on code.google.com by thestig@chromium.org on 9 Oct 2015 at 2:05

GoogleCodeExporter commented 8 years ago

Original comment by och...@chromium.org on 16 Oct 2015 at 12:56