Skip to content

Commit a17fafc

Browse files
committed
Disable strict mode when reading avif files
This fixes opencv#26011
1 parent 766bad0 commit a17fafc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

modules/imgcodecs/src/grfmt_avif.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ AvifDecoder::AvifDecoder() {
143143
m_buf_supported = true;
144144
channels_ = 0;
145145
decoder_ = avifDecoderCreate();
146+
decoder_->strictFlags = AVIF_STRICT_DISABLED;
146147
}
147148

148149
AvifDecoder::~AvifDecoder() {
@@ -166,6 +167,7 @@ bool AvifDecoder::checkSignature(const String &signature) const {
166167
std::unique_ptr<avifDecoder, decltype(&avifDecoderDestroy)> decoder(
167168
avifDecoderCreate(), avifDecoderDestroy);
168169
if (!decoder) return false;
170+
decoder->strictFlags = AVIF_STRICT_DISABLED;
169171
OPENCV_AVIF_CHECK_STATUS(
170172
avifDecoderSetIOMemory(
171173
decoder.get(), reinterpret_cast<const uint8_t *>(signature.c_str()),

0 commit comments

Comments
 (0)