safer directory set in tiff load

This commit is contained in:
John Cupitt 2020-06-03 16:41:29 +01:00
parent 0f57f3692b
commit 6e1fd6136d
1 changed files with 3 additions and 1 deletions

View File

@ -679,7 +679,9 @@ rtiff_n_pages( Rtiff *rtiff )
for( n = 1; TIFFReadDirectory( rtiff->tiff ); n++ )
;
rtiff->current_page = n - 1;
/* Make sure the nest set_page() will set the directory.
*/
rtiff->current_page = -1;
#ifdef DEBUG
printf( "rtiff_n_pages: found %d pages\n", n );