xref: /PHP-8.3/ext/exif/tests/bug79046.phpt (revision bd9f4fa6)
1--TEST--
2Bug #79046: NaN to int cast undefined behavior in exif
3--EXTENSIONS--
4exif
5--FILE--
6<?php
7var_dump(exif_read_data('data://image/tiff;base64,TU0AKgAAAA7//wAAANUAAQERAAsAAAABAAD4fwAAAA4A'));
8?>
9--EXPECT--
10array(8) {
11  ["FileDateTime"]=>
12  int(0)
13  ["FileSize"]=>
14  int(33)
15  ["FileType"]=>
16  int(8)
17  ["MimeType"]=>
18  string(10) "image/tiff"
19  ["SectionsFound"]=>
20  string(24) "ANY_TAG, IFD0, THUMBNAIL"
21  ["COMPUTED"]=>
22  array(2) {
23    ["IsColor"]=>
24    int(0)
25    ["ByteOrderMotorola"]=>
26    int(1)
27  }
28  ["StripOffsets"]=>
29  float(NAN)
30  ["THUMBNAIL"]=>
31  array(1) {
32    ["StripOffsets"]=>
33    float(NAN)
34  }
35}
36