aboutsummaryrefslogtreecommitdiffstats
path: root/math/vtk5
diff options
context:
space:
mode:
authorgahr <gahr@FreeBSD.org>2011-02-17 21:23:35 +0800
committergahr <gahr@FreeBSD.org>2011-02-17 21:23:35 +0800
commitc50461ab132cbd818d09acad00de6a01400be919 (patch)
tree2b877c66bdf83f8c55fe1e33c866d973ad5511bb /math/vtk5
parent6c76f97766460e7770ef12885ac051242a08a3ff (diff)
downloadfreebsd-ports-gnome-c50461ab132cbd818d09acad00de6a01400be919.tar.gz
freebsd-ports-gnome-c50461ab132cbd818d09acad00de6a01400be919.tar.zst
freebsd-ports-gnome-c50461ab132cbd818d09acad00de6a01400be919.zip
- Add a patch from upstream's GIT repository, which fixes a bug in
vtkJPEGWriter when writing to memory. - Bump PORTREVISION Original commit: http://vtk.org/gitweb?p=VTK.git;a=commit;h=e938db39c2bbd730a060cb0cf95fec52e15d281a
Diffstat (limited to 'math/vtk5')
-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);
+ }
+ }
+ }