Skip to content

Commit 2074392

Browse files
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
1 parent 7de15eb commit 2074392

4 files changed

Lines changed: 21 additions & 1 deletion

File tree

src/wp-includes/class-avif-info.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private function get_item_features( $target_item_id, $tile_depth ) {
175175
if ( $tile->parent_item_id != $target_item_id ) {
176176
continue;
177177
}
178-
$status = get_item_features( $tile->tile_item_id, $tile_depth + 1 );
178+
$status = $this->get_item_features( $tile->tile_item_id, $tile_depth + 1 );
179179
if ( $status != NOT_FOUND ) {
180180
return $status;
181181
}
924 Bytes
Binary file not shown.

tests/phpunit/tests/functions.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,17 @@ public function data_wp_getimagesize() {
15251525
'mime' => 'image/avif',
15261526
),
15271527
),
1528+
// Grid AVIF.
1529+
array(
1530+
DIR_TESTDATA . '/images/avif-alpha-grid2x1.avif',
1531+
array(
1532+
199,
1533+
200,
1534+
IMAGETYPE_AVIF,
1535+
'width="199" height="200"',
1536+
'mime' => 'image/avif',
1537+
),
1538+
),
15281539
);
15291540

15301541
return $data;

tests/phpunit/tests/image/editor.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,15 @@ public function data_wp_get_avif_info() {
447447
'num_channels' => 4,
448448
),
449449
),
450+
array(
451+
DIR_TESTDATA . '/images/avif-alpha-grid2x1.avif',
452+
array(
453+
'width' => 199,
454+
'height' => 200,
455+
'bit_depth' => 8,
456+
'num_channels' => 4,
457+
),
458+
),
450459
array(
451460
DIR_TESTDATA . '/images/colors_hdr_p3.avif',
452461
array(

0 commit comments

Comments
 (0)