summaryrefslogtreecommitdiff
path: root/include/vcl/BitmapConvolutionMatrixFilter.hxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-23 10:41:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-23 11:45:23 +0200
commit6122f6266c61db851d7595aeb824502172b509b2 (patch)
tree2aa0f7fa5c9fb0e9acd5f5602ef0cc5f86824dc7 /include/vcl/BitmapConvolutionMatrixFilter.hxx
parent6a068a90bb8b7625aca73e2c7c0a9e14a95b82be (diff)
fix memory management in BitmapConvolutionMatrixFilter
was deleting a stack allocated buffer. Also (*) drop the BitmapConvolutionMatrixFilter default constructor, the current code does not permit mpMatrix to be nullptr (*) declare the mpMatrix field as a reference to a fixed length array, to be more precise (*) pass the array in the constructor so that call sites will be properly type- and length-checked. Change-Id: I650d56cdfac0dae4ea77df7c0c03e19d658c00c8 Reviewed-on: https://gerrit.libreoffice.org/53312 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/vcl/BitmapConvolutionMatrixFilter.hxx')
-rw-r--r--include/vcl/BitmapConvolutionMatrixFilter.hxx13
1 files changed, 3 insertions, 10 deletions
diff --git a/include/vcl/BitmapConvolutionMatrixFilter.hxx b/include/vcl/BitmapConvolutionMatrixFilter.hxx
index a2189326322b..cae8c3d8a91c 100644
--- a/include/vcl/BitmapConvolutionMatrixFilter.hxx
+++ b/include/vcl/BitmapConvolutionMatrixFilter.hxx
@@ -20,22 +20,15 @@ class BitmapEx;
class VCL_DLLPUBLIC BitmapConvolutionMatrixFilter : public BitmapFilter
{
public:
- BitmapConvolutionMatrixFilter()
- : mpMatrix(nullptr)
+ BitmapConvolutionMatrixFilter(const long (&rMatrix)[9])
+ : mrMatrix(rMatrix)
{
}
- BitmapConvolutionMatrixFilter(const long* pMatrix)
- : mpMatrix(pMatrix)
- {
- }
-
- ~BitmapConvolutionMatrixFilter() override { delete mpMatrix; }
-
virtual BitmapEx execute(BitmapEx const& rBitmapEx) override;
protected:
- const long* mpMatrix;
+ const long (&mrMatrix)[9];
};
#endif