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