make radload slightly more robust
stops some valgrind warnings
This commit is contained in:
parent
acf5f5169a
commit
abe4e70d02
@ -2,6 +2,7 @@
|
|||||||
- fix a crash with SPARC byte-order labq vips images
|
- fix a crash with SPARC byte-order labq vips images
|
||||||
- fix parsing of filenames containing brackets, thanks shilpi230
|
- fix parsing of filenames containing brackets, thanks shilpi230
|
||||||
- fix hist_entropy (lovell)
|
- fix hist_entropy (lovell)
|
||||||
|
- small fixes to radiance load
|
||||||
|
|
||||||
12/1/16 started 8.2.2
|
12/1/16 started 8.2.2
|
||||||
- changes to ease compiling C++ binding with MSVC [Lovell Fuller]
|
- changes to ease compiling C++ binding with MSVC [Lovell Fuller]
|
||||||
|
@ -25,6 +25,7 @@ TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
|
|||||||
|
|
||||||
SETUP_FILES = \
|
SETUP_FILES = \
|
||||||
$(content_files) \
|
$(content_files) \
|
||||||
|
$(expand_content_files) \
|
||||||
$(DOC_MAIN_SGML_FILE) \
|
$(DOC_MAIN_SGML_FILE) \
|
||||||
$(DOC_MODULE)-sections.txt \
|
$(DOC_MODULE)-sections.txt \
|
||||||
$(DOC_MODULE)-overrides.txt
|
$(DOC_MODULE)-overrides.txt
|
||||||
@ -86,7 +87,7 @@ GTK_DOC_V_SETUP_0=@echo " DOC Preparing build";
|
|||||||
|
|
||||||
setup-build.stamp:
|
setup-build.stamp:
|
||||||
-$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
|
-$(GTK_DOC_V_SETUP)if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
|
||||||
files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
|
files=`echo $(SETUP_FILES) $(DOC_MODULE).types`; \
|
||||||
if test "x$$files" != "x" ; then \
|
if test "x$$files" != "x" ; then \
|
||||||
for file in $$files ; do \
|
for file in $$files ; do \
|
||||||
destdir=`dirname $(abs_builddir)/$$file`; \
|
destdir=`dirname $(abs_builddir)/$$file`; \
|
||||||
@ -118,7 +119,7 @@ scan-build.stamp: setup-build.stamp $(HFILE_GLOB) $(CFILE_GLOB)
|
|||||||
$(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
|
$(GTK_DOC_V_INTROSPECT)if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
|
||||||
scanobj_options=""; \
|
scanobj_options=""; \
|
||||||
gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \
|
gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \
|
||||||
if test "$(?)" = "0"; then \
|
if test "$$?" = "0"; then \
|
||||||
if test "x$(V)" = "x1"; then \
|
if test "x$(V)" = "x1"; then \
|
||||||
scanobj_options="--verbose"; \
|
scanobj_options="--verbose"; \
|
||||||
fi; \
|
fi; \
|
||||||
@ -162,17 +163,17 @@ GTK_DOC_V_XREF=$(GTK_DOC_V_XREF_$(V))
|
|||||||
GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY))
|
GTK_DOC_V_XREF_=$(GTK_DOC_V_XREF_$(AM_DEFAULT_VERBOSITY))
|
||||||
GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references";
|
GTK_DOC_V_XREF_0=@echo " DOC Fixing cross-references";
|
||||||
|
|
||||||
html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
|
html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files)
|
||||||
$(GTK_DOC_V_HTML)rm -rf html && mkdir html && \
|
$(GTK_DOC_V_HTML)rm -rf html && mkdir html && \
|
||||||
mkhtml_options=""; \
|
mkhtml_options=""; \
|
||||||
gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \
|
gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \
|
||||||
if test "$(?)" = "0"; then \
|
if test "$$?" = "0"; then \
|
||||||
if test "x$(V)" = "x1"; then \
|
if test "x$(V)" = "x1"; then \
|
||||||
mkhtml_options="$$mkhtml_options --verbose"; \
|
mkhtml_options="$$mkhtml_options --verbose"; \
|
||||||
fi; \
|
fi; \
|
||||||
fi; \
|
fi; \
|
||||||
gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
|
gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
|
||||||
if test "$(?)" = "0"; then \
|
if test "$$?" = "0"; then \
|
||||||
mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
|
mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
|
||||||
fi; \
|
fi; \
|
||||||
cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
|
cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
|
||||||
@ -194,11 +195,11 @@ GTK_DOC_V_PDF=$(GTK_DOC_V_PDF_$(V))
|
|||||||
GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY))
|
GTK_DOC_V_PDF_=$(GTK_DOC_V_PDF_$(AM_DEFAULT_VERBOSITY))
|
||||||
GTK_DOC_V_PDF_0=@echo " DOC Building PDF";
|
GTK_DOC_V_PDF_0=@echo " DOC Building PDF";
|
||||||
|
|
||||||
pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
|
pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(expand_content_files)
|
||||||
$(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \
|
$(GTK_DOC_V_PDF)rm -f $(DOC_MODULE).pdf && \
|
||||||
mkpdf_options=""; \
|
mkpdf_options=""; \
|
||||||
gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \
|
gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \
|
||||||
if test "$(?)" = "0"; then \
|
if test "$$?" = "0"; then \
|
||||||
if test "x$(V)" = "x1"; then \
|
if test "x$(V)" = "x1"; then \
|
||||||
mkpdf_options="$$mkpdf_options --verbose"; \
|
mkpdf_options="$$mkpdf_options --verbose"; \
|
||||||
fi; \
|
fi; \
|
||||||
@ -223,12 +224,15 @@ clean-local:
|
|||||||
@if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \
|
@if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-types" ; then \
|
||||||
rm -f $(DOC_MODULE).types; \
|
rm -f $(DOC_MODULE).types; \
|
||||||
fi
|
fi
|
||||||
|
@if echo $(SCAN_OPTIONS) | grep -q "\-\-rebuild-sections" ; then \
|
||||||
|
rm -f $(DOC_MODULE)-sections.txt; \
|
||||||
|
fi
|
||||||
|
|
||||||
distclean-local:
|
distclean-local:
|
||||||
@rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
|
@rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
|
||||||
$(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
|
$(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
|
||||||
@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
|
@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
|
||||||
rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
|
rm -f $(SETUP_FILES) $(DOC_MODULE).types; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
maintainer-clean-local:
|
maintainer-clean-local:
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<bookinfo>
|
<bookinfo>
|
||||||
<title>VIPS Reference Manual</title>
|
<title>VIPS Reference Manual</title>
|
||||||
<releaseinfo>
|
<releaseinfo>
|
||||||
For VIPS 8.2.2.
|
For VIPS 8.2.3.
|
||||||
The latest version of this documentation can be found on the
|
The latest version of this documentation can be found on the
|
||||||
<ulink role="online-location"
|
<ulink role="online-location"
|
||||||
url="http://www.vips.ecs.soton.ac.uk/index.php?title=Documentation">VIPS website</ulink>.
|
url="http://www.vips.ecs.soton.ac.uk/index.php?title=Documentation">VIPS website</ulink>.
|
||||||
|
@ -653,16 +653,23 @@ buffer_need( Buffer *buffer, int require )
|
|||||||
int remaining;
|
int remaining;
|
||||||
|
|
||||||
g_assert( require < BUFFER_MARGIN );
|
g_assert( require < BUFFER_MARGIN );
|
||||||
|
g_assert( buffer->length >= 0 );
|
||||||
|
g_assert( buffer->position >= 0 );
|
||||||
|
g_assert( buffer->position <= buffer->length );
|
||||||
|
|
||||||
remaining = buffer->length - buffer->position;
|
remaining = buffer->length - buffer->position;
|
||||||
if( remaining < require ) {
|
if( remaining < require ) {
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
memcpy( buffer->text,
|
/* Areas can overlap.
|
||||||
|
*/
|
||||||
|
memmove( buffer->text,
|
||||||
buffer->text + buffer->position, remaining );
|
buffer->text + buffer->position, remaining );
|
||||||
buffer->position = 0;
|
buffer->position = 0;
|
||||||
buffer->length = remaining;
|
buffer->length = remaining;
|
||||||
|
|
||||||
|
g_assert( buffer->length < BUFFER_MARGIN );
|
||||||
|
|
||||||
len = fread( buffer->text + buffer->length,
|
len = fread( buffer->text + buffer->length,
|
||||||
1, BUFFER_SIZE, buffer->fp );
|
1, BUFFER_SIZE, buffer->fp );
|
||||||
buffer->length += len;
|
buffer->length += len;
|
||||||
@ -687,6 +694,10 @@ scanline_read_old( Buffer *buffer, COLR *scanline, int width )
|
|||||||
{
|
{
|
||||||
int rshift;
|
int rshift;
|
||||||
|
|
||||||
|
g_assert( buffer->length >= 0 );
|
||||||
|
g_assert( buffer->position >= 0 );
|
||||||
|
g_assert( buffer->position <= buffer->length );
|
||||||
|
|
||||||
rshift = 0;
|
rshift = 0;
|
||||||
|
|
||||||
while( width > 0 ) {
|
while( width > 0 ) {
|
||||||
@ -728,6 +739,10 @@ scanline_read( Buffer *buffer, COLR *scanline, int width )
|
|||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
g_assert( buffer->length >= 0 );
|
||||||
|
g_assert( buffer->position >= 0 );
|
||||||
|
g_assert( buffer->position <= buffer->length );
|
||||||
|
|
||||||
/* Detect old-style scanlines.
|
/* Detect old-style scanlines.
|
||||||
*/
|
*/
|
||||||
if( width < MINELEN ||
|
if( width < MINELEN ||
|
||||||
@ -996,8 +1011,10 @@ static const char *colcor_name[3] = {
|
|||||||
static int
|
static int
|
||||||
rad2vips_get_header( Read *read, VipsImage *out )
|
rad2vips_get_header( Read *read, VipsImage *out )
|
||||||
{
|
{
|
||||||
int i, j;
|
|
||||||
VipsInterpretation interpretation;
|
VipsInterpretation interpretation;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
int i, j;
|
||||||
|
|
||||||
if( getheader( read->fin, (gethfunc *) rad2vips_process_line, read ) ||
|
if( getheader( read->fin, (gethfunc *) rad2vips_process_line, read ) ||
|
||||||
!fgetsresolu( &read->rs, read->fin ) ) {
|
!fgetsresolu( &read->rs, read->fin ) ) {
|
||||||
@ -1013,9 +1030,17 @@ rad2vips_get_header( Read *read, VipsImage *out )
|
|||||||
else
|
else
|
||||||
interpretation = VIPS_INTERPRETATION_MULTIBAND;
|
interpretation = VIPS_INTERPRETATION_MULTIBAND;
|
||||||
|
|
||||||
vips_image_init_fields( out,
|
width = scanlen( &read->rs );
|
||||||
scanlen( &read->rs ), numscans( &read->rs ),
|
height = numscans( &read->rs );
|
||||||
4,
|
if( width <= 0 ||
|
||||||
|
width > VIPS_MAX_COORD ||
|
||||||
|
height <= 0 ||
|
||||||
|
height > VIPS_MAX_COORD ) {
|
||||||
|
vips_error( "rad2vips", "%s", _( "image size out of bounds" ) );
|
||||||
|
return( -1 );
|
||||||
|
}
|
||||||
|
|
||||||
|
vips_image_init_fields( out, width, height, 4,
|
||||||
VIPS_FORMAT_UCHAR, VIPS_CODING_RAD,
|
VIPS_FORMAT_UCHAR, VIPS_CODING_RAD,
|
||||||
interpretation,
|
interpretation,
|
||||||
1, read->aspect );
|
1, read->aspect );
|
||||||
@ -1080,6 +1105,7 @@ rad2vips_generate( VipsRegion *or,
|
|||||||
if( scanline_read( read->buffer, buf, or->im->Xsize ) ) {
|
if( scanline_read( read->buffer, buf, or->im->Xsize ) ) {
|
||||||
vips_error( "rad2vips",
|
vips_error( "rad2vips",
|
||||||
_( "read error line %d" ), r->top + y );
|
_( "read error line %d" ), r->top + y );
|
||||||
|
VIPS_GATE_STOP( "rad2vips_generate: work" );
|
||||||
return( -1 );
|
return( -1 );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user