Media: fix potential error in class-avif-info.php::get_item_features().

Import upstream fix from libavifinfo, correcting a potential fatal error.

Props yguyon.
Fixes #60980.



git-svn-id: https://develop.svn.wordpress.org/trunk@58049 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Adam Silverstein
2024-04-26 15:00:03 +00:00
parent 7de15eb4b0
commit 2074392c5c
4 changed files with 21 additions and 1 deletions

View File

@ -175,7 +175,7 @@ class Features {
if ( $tile->parent_item_id != $target_item_id ) { if ( $tile->parent_item_id != $target_item_id ) {
continue; continue;
} }
$status = get_item_features( $tile->tile_item_id, $tile_depth + 1 ); $status = $this->get_item_features( $tile->tile_item_id, $tile_depth + 1 );
if ( $status != NOT_FOUND ) { if ( $status != NOT_FOUND ) {
return $status; return $status;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 924 B

View File

@ -1525,6 +1525,17 @@ class Tests_Functions extends WP_UnitTestCase {
'mime' => 'image/avif', 'mime' => 'image/avif',
), ),
), ),
// Grid AVIF.
array(
DIR_TESTDATA . '/images/avif-alpha-grid2x1.avif',
array(
199,
200,
IMAGETYPE_AVIF,
'width="199" height="200"',
'mime' => 'image/avif',
),
),
); );
return $data; return $data;

View File

@ -447,6 +447,15 @@ class Tests_Image_Editor extends WP_Image_UnitTestCase {
'num_channels' => 4, 'num_channels' => 4,
), ),
), ),
array(
DIR_TESTDATA . '/images/avif-alpha-grid2x1.avif',
array(
'width' => 199,
'height' => 200,
'bit_depth' => 8,
'num_channels' => 4,
),
),
array( array(
DIR_TESTDATA . '/images/colors_hdr_p3.avif', DIR_TESTDATA . '/images/colors_hdr_p3.avif',
array( array(