I didn't either at first, and then Lei pointed out it's using
set/longjmp.  Gnarly.

On Mon, Jul 6, 2009 at 4:26 PM, Evan Martin<e...@chromium.org> wrote:
>
> I don't understand this bug report.  Where is the code path that
> allocates memory but doesn't free it?  You just wrote "if error
> happens in libjpeg" but that is not clear.
>
> On Mon, Jul 6, 2009 at 1:50 AM, runtime<run_t...@tut.by> wrote:
>>
>> I sent a bug report
>> http://code.google.com/p/chromium/issues/detail?id=15990
>> I don't know I did it correct or not.
>>
>> Lei Zhang wrote:
>>> It probably needs to be converted into a scoped_array like in
>>> JPEGCodec::Decode. Can you file a bug for this on http://crbug.com/ ?
>>>
>>> On Thu, Jul 2, 2009 at 5:59 AM, runtime<run_t...@tut.by> wrote:
>>> >
>>> > Hi
>>> > 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.
>>> >
>>> > >
>>> >
>> >
>>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
Chromium Developers mailing list: chromium-dev@googlegroups.com 
View archives, change email options, or unsubscribe: 
    http://groups.google.com/group/chromium-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to