aboutsummaryrefslogtreecommitdiff
path: root/math
diff options
context:
space:
mode:
authorPietro Cerutti <gahr@FreeBSD.org>2011-02-17 13:23:35 +0000
committerPietro Cerutti <gahr@FreeBSD.org>2011-02-17 13:23:35 +0000
commitdf605311bd67eac724f99af0bda573fe90558082 (patch)
tree22e46b56527962d5a0b12b5c7a1f095e6551f136 /math
parentf40891a54997aab68d53a7c3069f85b970de82f6 (diff)
downloadports-df605311bd67eac724f99af0bda573fe90558082.tar.gz
ports-df605311bd67eac724f99af0bda573fe90558082.zip
Notes
Diffstat (limited to 'math')
-rw-r--r--math/vtk5/Makefile2
-rw-r--r--math/vtk5/files/patch-VTK_IO_vtkJPEGWriter.cxx46
2 files changed, 47 insertions, 1 deletions
diff --git a/math/vtk5/Makefile b/math/vtk5/Makefile
index face74165e6b..ac9fb6556d68 100644
--- a/math/vtk5/Makefile
+++ b/math/vtk5/Makefile
@@ -8,7 +8,7 @@
PORTNAME= vtk
PORTVERSION= 5.6.1
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= math graphics
MASTER_SITES= http://www.vtk.org/files/release/${PORTVERSION:R}/ \
http://www.neuro.mcw.edu/Ports/distfiles/VTK5/
diff --git a/math/vtk5/files/patch-VTK_IO_vtkJPEGWriter.cxx b/math/vtk5/files/patch-VTK_IO_vtkJPEGWriter.cxx
new file mode 100644
index 000000000000..29444cbbe752
--- /dev/null
+++ b/math/vtk5/files/patch-VTK_IO_vtkJPEGWriter.cxx
@@ -0,0 +1,46 @@
+--- IO/vtkJPEGWriter.cxx
++++ IO/vtkJPEGWriter.cxx
+@@ -129,7 +129,7 @@ void vtkJPEGWriter::Write()
+ this->InternalFileName = NULL;
+ }
+
+-// these three routines are for wqriting into memory
++// these three routines are for writing into memory
+ extern "C"
+ {
+ void vtkJPEGWriteToMemoryInit(j_compress_ptr cinfo)
+@@ -157,16 +157,20 @@ extern "C"
+ {
+ boolean vtkJPEGWriteToMemoryEmpty(j_compress_ptr cinfo)
+ {
++ // Even if (cinfo->dest->free_in_buffer != 0) we still need to write on the
++ // new array and not at (arraySize - nbFree)
+ vtkJPEGWriter *self = vtkJPEGWriter::SafeDownCast(
+ static_cast<vtkObject *>(cinfo->client_data));
+ if (self)
+ {
+ vtkUnsignedCharArray *uc = self->GetResult();
+- // we must grow the array, we grow by 50% each time
++ // we must grow the array
+ int oldSize = uc->GetSize();
+- uc->Resize(oldSize + oldSize/2);
++ uc->Resize(oldSize*1.5);
++ // Resize do grow the array but it is not the size we expect
++ int newSize = uc->GetSize();
+ cinfo->dest->next_output_byte = uc->GetPointer(oldSize);
+- cinfo->dest->free_in_buffer = oldSize/2;
++ cinfo->dest->free_in_buffer = newSize - oldSize;
+ }
+ return TRUE;
+ }
+@@ -182,8 +186,8 @@ extern "C"
+ {
+ vtkUnsignedCharArray *uc = self->GetResult();
+ // we must close the array
+- vtkIdType oldSize = uc->GetSize();
+- uc->SetNumberOfTuples(oldSize - static_cast<vtkIdType>(cinfo->dest->free_in_buffer));
++ int realSize = uc->GetSize() - cinfo->dest->free_in_buffer;
++ uc->SetNumberOfTuples(realSize);
+ }
+ }
+ }