imgcodecs(tiff): avoid leak of helper struct on malformed inputs

backporting of commit: 45428b897f
pull/14214/head
Alexander Alekhin 6 years ago
parent 6894651027
commit 2ece029fe0
  1. 2
      modules/imgcodecs/src/grfmt_tiff.cpp

@ -214,6 +214,8 @@ bool TiffDecoder::readHeader()
&TiffDecoderBufHelper::write, &TiffDecoderBufHelper::seek,
&TiffDecoderBufHelper::close, &TiffDecoderBufHelper::size,
&TiffDecoderBufHelper::map, /*unmap=*/0 );
if (!tif)
delete buf_helper;
}
else
{

Loading…
Cancel
Save