make out of order read a fatal error
For png and jpg, out of order must always be a fatal error, since you can't read from a specific y position. This was a g_assert() before which meant that this test was missing from production builds. It's now always a fatal error.
This commit is contained in:
parent
70b35f5ec5
commit
e9ce212b62
@ -5,6 +5,7 @@
|
|||||||
- fix memleak in VipsArray [Lovell]
|
- fix memleak in VipsArray [Lovell]
|
||||||
- fix memleak in webp load from buffer [Lovell]
|
- fix memleak in webp load from buffer [Lovell]
|
||||||
- fix memleak in png save to buffer [Lovell]
|
- fix memleak in png save to buffer [Lovell]
|
||||||
|
- make out of order read in png and jpg a fatal error
|
||||||
|
|
||||||
12/8/14 started 7.40.6
|
12/8/14 started 7.40.6
|
||||||
- more doc fixes
|
- more doc fixes
|
||||||
|
@ -916,7 +916,11 @@ read_jpeg_generate( VipsRegion *or,
|
|||||||
/* And check that y_pos is correct. It should be, since we are inside
|
/* And check that y_pos is correct. It should be, since we are inside
|
||||||
* a vips_sequential().
|
* a vips_sequential().
|
||||||
*/
|
*/
|
||||||
g_assert( r->top == jpeg->y_pos );
|
if( r->top != jpeg->y_pos ) {
|
||||||
|
vips_error( "VipsJpeg",
|
||||||
|
_( "out of order read at line %d" ), jpeg->y_pos );
|
||||||
|
return( -1 );
|
||||||
|
}
|
||||||
|
|
||||||
/* Here for longjmp() from vips__new_error_exit().
|
/* Here for longjmp() from vips__new_error_exit().
|
||||||
*/
|
*/
|
||||||
|
@ -483,7 +483,11 @@ png2vips_generate( VipsRegion *or,
|
|||||||
/* And check that y_pos is correct. It should be, since we are inside
|
/* And check that y_pos is correct. It should be, since we are inside
|
||||||
* a vips_sequential().
|
* a vips_sequential().
|
||||||
*/
|
*/
|
||||||
g_assert( r->top == read->y_pos );
|
if( r->top != read->y_pos ) {
|
||||||
|
vips_error( "vipspng",
|
||||||
|
_( "out of order read at line %d" ), read->y_pos );
|
||||||
|
return( -1 );
|
||||||
|
}
|
||||||
|
|
||||||
for( y = 0; y < r->height; y++ ) {
|
for( y = 0; y < r->height; y++ ) {
|
||||||
png_bytep q = (png_bytep) VIPS_REGION_ADDR( or, 0, r->top + y );
|
png_bytep q = (png_bytep) VIPS_REGION_ADDR( or, 0, r->top + y );
|
||||||
|
Loading…
Reference in New Issue
Block a user