-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Fix runtime error with empty buffers when linking against UCRT (lovell/sharp#2494). - Fix AVIF decode/encode on CPUs lacking support for the AVX2 instruction set (kleisauke/net-vips#104).
- Loading branch information
Showing
2 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Kleis Auke Wolthuizen <[email protected]> | ||
Date: Tue, 22 Dec 2020 10:32:43 +0100 | ||
Subject: [PATCH 1/2] Ensure memory source is non-null | ||
|
||
|
||
diff --git a/libvips/iofuncs/source.c b/libvips/iofuncs/source.c | ||
index 1111111..2222222 100644 | ||
--- a/libvips/iofuncs/source.c | ||
+++ b/libvips/iofuncs/source.c | ||
@@ -318,7 +318,9 @@ vips_source_build( VipsObject *object ) | ||
if( vips_object_argument_isset( object, "blob" ) ) { | ||
size_t length; | ||
|
||
- source->data = vips_blob_get( source->blob, &length ); | ||
+ if( !(source->data = vips_blob_get( source->blob, &length )) ) | ||
+ return( -1 ); | ||
+ | ||
source->length = VIPS_MIN( length, G_MAXSSIZE ); | ||
} | ||
|
||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Kleis Auke Wolthuizen <[email protected]> | ||
Date: Tue, 22 Dec 2020 11:19:09 +0100 | ||
Subject: [PATCH 2/2] Avoid seeking on bad file descriptors | ||
|
||
|
||
diff --git a/libvips/iofuncs/source.c b/libvips/iofuncs/source.c | ||
index 1111111..2222222 100644 | ||
--- a/libvips/iofuncs/source.c | ||
+++ b/libvips/iofuncs/source.c | ||
@@ -348,16 +348,15 @@ vips_source_seek_real( VipsSource *source, gint64 offset, int whence ) | ||
{ | ||
VipsConnection *connection = VIPS_CONNECTION( source ); | ||
|
||
- gint64 new_pos; | ||
- | ||
VIPS_DEBUG_MSG( "vips_source_seek_real:\n" ); | ||
|
||
/* Like _read_real(), we must not set a vips_error. We need to use the | ||
* vips__seek() wrapper so we can seek long files on Windows. | ||
*/ | ||
- new_pos = vips__seek_no_error( connection->descriptor, offset, whence ); | ||
+ if( connection->descriptor != -1 ) | ||
+ return( vips__seek_no_error( connection->descriptor, offset, whence ) ); | ||
|
||
- return( new_pos ); | ||
+ return( -1 ); | ||
} | ||
|
||
static void |