rem: if (document_index != 1 && !TIFFSetDirectory(tif, document_index - 1))
add: if (!TIFFSetDirectory(tif, document_index - 1))
context: identify_tiff_header(BPositionIO *inSource, BMessage *ioExtension,	translator_info *outInfo, uint32 outType, TIFF **poutTIFF = NULL){	// Can only output to bits for now	if (outType != B_TRANSLATOR_BITMAP)		return B_NO_TRANSLATOR;		// reset pos to start	inSource->Seek(0, SEEK_SET);		// get TIFF handle		TIFF* tif = TIFFClientOpen("TIFFTranslator", "r", inSource,		tiff_read_proc, tiff_write_proc, tiff_seek_proc, tiff_close_proc,		tiff_size_proc, tiff_map_file_proc, tiff_unmap_file_proc);     if (!tif)    	return B_NO_TRANSLATOR;		// count number of documents	int32 document_count = 0, document_index = 1;	do {		document_count++;	} while (TIFFReadDirectory(tif));		if (ioExtension) {		// add page count to ioExtension		ioExtension->RemoveName(DOCUMENT_COUNT);		ioExtension->AddInt32(DOCUMENT_COUNT, document_count);				// Check if a document index has been specified		ioExtension->FindInt32(DOCUMENT_INDEX, &document_index);		if (document_index < 1 || document_index > document_count)			return B_NO_TRANSLATOR;	}		// identify the document the user specified or the first document	// if the user did not specify which document they wanted to identify	if (document_index != 1 && !TIFFSetDirectory(tif, document_index - 1))		return B_NO_TRANSLATOR;	if (outInfo) {		outInfo->type = B_TIFF_FORMAT;		outInfo->group = B_TRANSLATOR_BITMAP;		outInfo->quality = TIFF_IN_QUALITY;		outInfo->capability = TIFF_IN_CAPABILITY;		strcpy(outInfo->MIME, "image/tiff");		strcpy(outInfo->name, "TIFF image");	}		if (!poutTIFF)		// close TIFF if caller is not interested in TIFF handle		TIFFClose(tif);	else		// leave TIFF open and return handle if caller needs it		*poutTIFF = tif;			return B_OK;}