diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2014-04-09 16:35:52 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2014-04-09 16:36:19 +0900 |
commit | 22f7c87dbdc5a6157012fcb2c0ed60fe4e022509 (patch) | |
tree | d5f3882d8051498f577ed59481df2aaefeaf51d7 /filter/source/graphicfilter/ipsd/ipsd.cxx | |
parent | 01f529b546b96e651c03ba9b0a92ec956d4813b3 (diff) |
Avoid possible memory leaks in case of exceptions
Change-Id: I288c77190a8205ba320bb788a52f3b2ef9d2557f
Diffstat (limited to 'filter/source/graphicfilter/ipsd/ipsd.cxx')
-rw-r--r-- | filter/source/graphicfilter/ipsd/ipsd.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx index 1dbe3cb19bc1..45b923c4d88d 100644 --- a/filter/source/graphicfilter/ipsd/ipsd.cxx +++ b/filter/source/graphicfilter/ipsd/ipsd.cxx @@ -21,6 +21,7 @@ #include <vcl/graph.hxx> #include <vcl/bmpacc.hxx> #include <vcl/outdev.hxx> +#include <boost/scoped_array.hpp> class FilterConfigItem; @@ -577,7 +578,7 @@ sal_Bool PSDReader::ImplReadBody() if ( mpFileHeader->nMode == PSD_CMYK ) { sal_uInt32 nBlack, nBlackMax = 0; - sal_uInt8* pBlack = new sal_uInt8[ mpFileHeader->nRows * mpFileHeader->nColumns ]; + boost::scoped_array<sal_uInt8> pBlack(new sal_uInt8[ mpFileHeader->nRows * mpFileHeader->nColumns ]); nY = 0; while ( nY < mpFileHeader->nRows ) { @@ -654,7 +655,6 @@ sal_Bool PSDReader::ImplReadBody() mpWriteAcc->SetPixel( nY, nX, BitmapColor( cR, cG, cB ) ); } } - delete[] pBlack; } } break; |