diff --git a/modules/imgcodecs/src/grfmt_avif.cpp b/modules/imgcodecs/src/grfmt_avif.cpp index c1d3682d0c..98ddb73362 100644 --- a/modules/imgcodecs/src/grfmt_avif.cpp +++ b/modules/imgcodecs/src/grfmt_avif.cpp @@ -143,6 +143,7 @@ AvifDecoder::AvifDecoder() { m_buf_supported = true; channels_ = 0; decoder_ = avifDecoderCreate(); + decoder_->strictFlags = AVIF_STRICT_DISABLED; } AvifDecoder::~AvifDecoder() { @@ -166,6 +167,7 @@ bool AvifDecoder::checkSignature(const String &signature) const { std::unique_ptr decoder( avifDecoderCreate(), avifDecoderDestroy); if (!decoder) return false; + decoder->strictFlags = AVIF_STRICT_DISABLED; OPENCV_AVIF_CHECK_STATUS( avifDecoderSetIOMemory( decoder.get(), reinterpret_cast(signature.c_str()),