Ensure EXIF is at least 4 bytes before inspection (#3109)
This commit is contained in:
parent
53a3e6d819
commit
c76d74be65
@ -167,6 +167,10 @@ vips_exif_load_data_without_fix( const void *data, size_t length )
|
|||||||
/* exif_data_load_data() only allows uint for length. Limit it to less
|
/* exif_data_load_data() only allows uint for length. Limit it to less
|
||||||
* than that: 2**20 should be enough for anyone.
|
* than that: 2**20 should be enough for anyone.
|
||||||
*/
|
*/
|
||||||
|
if( length < 4 ) {
|
||||||
|
vips_error( "exif", "%s", _( "exif too small" ) );
|
||||||
|
return( NULL );
|
||||||
|
}
|
||||||
if( length > 1 << 20 ) {
|
if( length > 1 << 20 ) {
|
||||||
vips_error( "exif", "%s", _( "exif too large" ) );
|
vips_error( "exif", "%s", _( "exif too large" ) );
|
||||||
return( NULL );
|
return( NULL );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user