fix a couple of issues with huge profiles

The base64 encode limit was 1MB, but some huge profiles can get over
that, so it's now 10MB.

transform_save_string_blob() was incorrectly setting a refstring not a
blob as an error fallback, potentially leaving a dangling pointer.

Thanks Jaume!

See https://github.com/jcupitt/libvips/issues/666
This commit is contained in:
John Cupitt 2017-05-26 09:04:15 +01:00
parent 5df65ec6fd
commit 7b64246af2
3 changed files with 7 additions and 3 deletions

View File

@ -1,5 +1,7 @@
19/5/17 started 8.5.6
- tiff read with start page > 0 could break edge tiles or strips
- raise b64 limit to allow for huge profiles (thanks jaume)
- fix error return in blob save (thanks jaume)
23/4/17 started 8.5.5
- doc polishing

View File

@ -65,7 +65,7 @@ Modified on:
- move to vips_ namespace
31/5/15
- oops siged/unsignned mess-up meant we were not padding correctly
- oops siged/unsigned mess-up meant we were not padding correctly
*/
@ -237,7 +237,9 @@ vips__b64_decode( const char *buffer, size_t *data_length )
int nbits;
int i;
if( output_data_length > 1024 * 1024 ) {
/* A large ICC profile can be a couple of MB, so 10 should be plenty.
*/
if( output_data_length > 10 * 1024 * 1024 ) {
/* We shouldn't really be used for large amounts of data, plus
* we are using an int for offset.
*/

View File

@ -692,7 +692,7 @@ transform_save_string_blob( const GValue *src_value, GValue *dest_value )
/* No error return from transform, but we should set it to
* something.
*/
vips_value_set_save_string( dest_value, "" );
vips_value_set_blob( dest_value, NULL, NULL, 0 );
}
GType