fix memory leak when reading invalid tiff - refs #1783
This commit is contained in:
parent
16e2e8a06f
commit
771cbb11bf
1 changed files with 3 additions and 2 deletions
|
@ -118,11 +118,12 @@ void tiff_reader::on_error(const char* /*module*/, const char* fmt, va_list argp
|
|||
void tiff_reader::init()
|
||||
{
|
||||
// TODO: error handling
|
||||
TIFFSetWarningHandler(0);
|
||||
TIFFSetErrorHandler(on_error);
|
||||
TIFF* tif = load_if_exists(file_name_);
|
||||
if (!tif) throw image_reader_exception( std::string("Can't load tiff file: '") + file_name_ + "'");
|
||||
|
||||
TIFFSetWarningHandler(0);
|
||||
TIFFSetErrorHandler(on_error);
|
||||
|
||||
char msg[1024];
|
||||
|
||||
if (TIFFRGBAImageOK(tif,msg))
|
||||
|
|
Loading…
Reference in a new issue