Skip to content

Commit bacefd3

Browse files
authored
Merge pull request opencv#26077 from vrabaud:avif_check
Disable strict mode when reading avif files
2 parents 766bad0 + a17fafc commit bacefd3

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)