Status: Unconfirmed
Owner: ----
Labels: Type-Bug Pri-2 OS-All Area-Misc

New issue 15990 by [email protected]: memory leak in the jpeg_codec.cc
http://code.google.com/p/chromium/issues/detail?id=15990

There is memory leak in the module jpeg_codec.cc, member function

bool JPEGCodec::Encode(const unsigned char* input, ColorFormat format,
                        int w, int h, int row_byte_width,
                        int quality, std::vector<unsigned char>*
output);

code

     // output row after converting
     unsigned char* row = new unsigned char[w * 3];

     while (cinfo.next_scanline < cinfo.image_height) {
       converter(&input[cinfo.next_scanline * row_byte_width], w, row);
       jpeg_write_scanlines(&cinfo, &row, 1);
     }
     delete[] row;

The allocated in row pointer memory will not be released if error
happens in libjpeg.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
Automated mail from issue updates at http://crbug.com/
Subscription options: http://groups.google.com/group/chromium-bugs
-~----------~----~----~----~------~----~------~--~---

Reply via email to