From 2c0a864ba31bbfbb082c2b68dd529c23b01265b6 Mon Sep 17 00:00:00 2001 From: Michael Pfeiffer Date: Sun, 21 Nov 2004 10:28:42 +0000 Subject: [PATCH] Use dynamic memory allocation instead of stack allocation to avoid PPC compiler error. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10109 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/print/drivers/shared/libprint/HalftoneView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/add-ons/print/drivers/shared/libprint/HalftoneView.cpp b/src/add-ons/print/drivers/shared/libprint/HalftoneView.cpp index 8d2dca46c1..589166f2a2 100644 --- a/src/add-ons/print/drivers/shared/libprint/HalftoneView.cpp +++ b/src/add-ons/print/drivers/shared/libprint/HalftoneView.cpp @@ -70,7 +70,7 @@ void HalftonePreviewView::preview(float gamma, float min, Halftone::DitherType d halftone.setBlackValue(Halftone::kLowValueMeansBlack); const int widthBytes = (width + 7) / 8; // byte boundary - uchar buffer[widthBytes]; + uchar* buffer = new uchar[widthBytes]; const uchar* src = (uchar*)testImage.Bits(); uchar* dstRow = (uchar*)preview.Bits(); @@ -116,6 +116,8 @@ void HalftonePreviewView::preview(float gamma, float min, Halftone::DitherType d src += testImage.BytesPerRow(); dstRow += preview.BytesPerRow(); } + + delete buffer; SetViewBitmap(&preview); Invalidate();