1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-30 07:43:03 +04:00

Merge pull request #26077 from vrabaud:avif_check

Disable strict mode when reading avif files
This commit is contained in:
Alexander Smorkalov
2024-08-28 16:15:01 +03:00
committed by GitHub
+2
View File
@@ -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<avifDecoder, decltype(&avifDecoderDestroy)> decoder(
avifDecoderCreate(), avifDecoderDestroy);
if (!decoder) return false;
decoder->strictFlags = AVIF_STRICT_DISABLED;
OPENCV_AVIF_CHECK_STATUS(
avifDecoderSetIOMemory(
decoder.get(), reinterpret_cast<const uint8_t *>(signature.c_str()),