Skip to content
This repository was archived by the owner on Apr 8, 2024. It is now read-only.

Commit d901517

Browse files
defHLTfacebook-github-bot
authored andcommitted
Upgrade libavif to 0.9.0
Summary: Fixed the following FB files due to changes in avifDecoderParse and new avifDecoderSetIOMemory API: - AvifUtils.cpp - AvifDecompressor.cpp - MOSCachedAVIF.mm Updated version in README.facebook Reviewed By: AurelC2G Differential Revision: D26815971 fbshipit-source-id: ebd45715f710fb2291eda4473f1b0ff1d1ede9b0
1 parent 2c05090 commit d901517

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

cpp/spectrum/plugins/avif/AvifDecompressor.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,18 @@ void AvifDecompressor::_parseContainer() {
5757
}
5858

5959
_sourceData = readEntireImageSource(_source);
60-
avifROData input{_sourceData.data(), _sourceData.size()};
6160

6261
_decoder = avifDecoderCreate();
62+
63+
SPECTRUM_ERROR_CSTR_IF_NOT(
64+
AVIF_RESULT_OK ==
65+
avifDecoderSetIOMemory(
66+
_decoder, _sourceData.data(), _sourceData.size()),
67+
codecs::error::DecompressorFailure,
68+
"failed avifDecoderSetIOMemory");
69+
6370
SPECTRUM_ERROR_CSTR_IF_NOT(
64-
AVIF_RESULT_OK == avifDecoderParse(_decoder, &input) &&
71+
AVIF_RESULT_OK == avifDecoderParse(_decoder) &&
6572
_decoder->image != nullptr,
6673
codecs::error::DecompressorFailure,
6774
"failed avifDecoderParse");

0 commit comments

Comments
 (0)