xref: /PHP-7.2/ext/exif/tests/bug72627.phpt (revision 6dbb1ee4)
1--TEST--
2Bug #72627 (Memory Leakage In exif_process_IFD_in_TIFF)
3--SKIPIF--
4<?php if (!extension_loaded('exif')) print 'skip exif extension not available';?>
5--FILE--
6<?php
7	$exif = exif_read_data(__DIR__ . '/bug72627.tiff',0,0,true);
8	var_dump($exif);
9?>
10--EXPECTF--
11Warning: exif_read_data(%s): Thumbnail goes IFD boundary or end of file reached in %sbug72627.php on line %d
12
13Warning: exif_read_data(%s): Error in TIFF: filesize(x04E2) less than start of IFD dir(x829A0004) in %sbug72627.php on line %d
14
15Warning: exif_read_data(%s): Thumbnail goes IFD boundary or end of file reached in %sbug72627.php on line %d
16array(11) {
17  ["FileName"]=>
18  string(13) "bug72627.tiff"
19  ["FileDateTime"]=>
20  int(%d)
21  ["FileSize"]=>
22  int(1250)
23  ["FileType"]=>
24  int(7)
25  ["MimeType"]=>
26  string(10) "image/tiff"
27  ["SectionsFound"]=>
28  string(30) "ANY_TAG, IFD0, THUMBNAIL, EXIF"
29  ["COMPUTED"]=>
30  array(10) {
31    ["html"]=>
32    string(24) "width="128" height="132""
33    ["Height"]=>
34    int(132)
35    ["Width"]=>
36    int(128)
37    ["IsColor"]=>
38    int(0)
39    ["ByteOrderMotorola"]=>
40    int(0)
41    ["ApertureFNumber"]=>
42    string(5) "f/1.0"
43    ["Thumbnail.FileType"]=>
44    int(2)
45    ["Thumbnail.MimeType"]=>
46    string(10) "image/jpeg"
47    ["Thumbnail.Height"]=>
48    int(132)
49    ["Thumbnail.Width"]=>
50    int(128)
51  }
52  ["XResolution"]=>
53  string(21) "1414812756/1414812756"
54  ["THUMBNAIL"]=>
55  array(5) {
56    ["ImageWidth"]=>
57    int(128)
58    ["ImageLength"]=>
59    int(132)
60    ["JPEGInterchangeFormat"]=>
61    int(1280)
62    ["JPEGInterchangeFormatLength"]=>
63    int(100)
64    ["THUMBNAIL"]=>
65    NULL
66  }
67  ["ExposureTime"]=>
68  string(21) "1414812756/1414812756"
69  ["FNumber"]=>
70  string(21) "1414812756/1414812756"
71}
72