1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-28 01:06:17 +00:00
freebsd-ports/graphics/pfstools/files/patch-src-fileformat-pfsinjpeghdr.cpp
Danilo Egea Gondolfo ce3d606a5b - Update from 1.6.4 to 1.8.5 [1]
- Use options helpers

PR:		ports/191179
Submitted by:	ii@any.com.ru [1]
2014-06-20 17:17:54 +00:00

23 lines
975 B
C++

--- src/fileformat/pfsinjpeghdr.cpp.orig 2005-11-04 08:54:27.000000000 +0000
+++ src/fileformat/pfsinjpeghdr.cpp 2014-02-20 19:04:01.546588828 +0000
@@ -123,8 +123,8 @@
case JPEG_HEADER_HDR: // HDR image
jpeghdr_start_decompress(&jhinf);
frame = pfsio.createFrame( jhinf.cinfo.output_width, jhinf.cinfo.output_height );
- hdrscan = (JHSAMPLE *)malloc(jhinf.cinfo.output_width * jhinf.cinfo.output_height *
- sizeof(JHSAMPLE)*3);
+ hdrscan =
+ new JHSAMPLE[jhinf.cinfo.output_width * jhinf.cinfo.output_height * 3];
// Important: test jhinf.output_scanline, not jhinf.cinfo
int index ;
index = 0;
@@ -144,7 +144,7 @@
(Z->getRawData())[i] = hdrscan[3*i + 2];
}
pfs::transformColorSpace( pfs::CS_RGB, X, Y, Z, pfs::CS_XYZ, X, Y, Z );
- free((void *)hdrscan);
+ delete[] hdrscan;
break;
case JPEG_HEADER_OK: // LDR image
case JPEG_SUSPENDED: