diff options
Diffstat (limited to 'base/gfx')
-rw-r--r-- | base/gfx/jpeg_codec.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/base/gfx/jpeg_codec.cc b/base/gfx/jpeg_codec.cc index f2e82c2..da0611d 100644 --- a/base/gfx/jpeg_codec.cc +++ b/base/gfx/jpeg_codec.cc @@ -247,13 +247,13 @@ bool JPEGCodec::Encode(const unsigned char* input, ColorFormat format, } // output row after converting - unsigned char* row = new unsigned char[w * 3]; + scoped_array<unsigned char> row_data(new unsigned char[w * 3]); + unsigned char* row = row_data.get(); 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; } jpeg_finish_compress(&cinfo); |