Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CAMP
campvis-public
Commits
1be35662
Commit
1be35662
authored
Sep 30, 2014
by
Christian Schulte zu Berge
Browse files
Fixed memory issues in devilimagereader.cpp
parent
34f2d265
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/devil/processors/devilimagereader.cpp
View file @
1be35662
...
...
@@ -227,8 +227,6 @@ namespace campvis {
}
// get data from image and transform to single intensity image:
ILubyte
*
data
=
ilGetData
();
ilCopyPixels
(
0
,
0
,
0
,
imageSize
.
x
,
imageSize
.
y
,
1
,
devilFormat
,
devilDataType
,
buffer
+
(
WeaklyTypedPointer
::
numBytes
(
campvisDataType
,
numChannels
)
*
i
*
imageSize
.
x
*
imageSize
.
y
));
ILint
err
=
ilGetError
();
if
(
err
!=
IL_NO_ERROR
)
{
...
...
@@ -257,8 +255,10 @@ namespace campvis {
rd
->
addColorTexture
(
id
);
// create fake depth image
// TODO: think of a better solution to this...
ImageData
*
idDepth
=
new
ImageData
(
dimensionality
,
imageSize
,
1
);
float
*
ptr
=
new
float
[
tgt
::
hmul
(
imageSize
)];
memset
(
ptr
,
0
,
tgt
::
hmul
(
imageSize
)
*
sizeof
(
float
));
WeaklyTypedPointer
wtpDepth
(
campvisDataType
,
1
,
ptr
);
ImageRepresentationLocal
::
create
(
idDepth
,
wtpDepth
);
rd
->
setDepthTexture
(
idDepth
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment