Update to libavif-0.6.3.

from Brad (maintainer)
This commit is contained in:
ajacoutot
2020-04-04 08:35:17 +00:00
parent 46c1d49d62
commit a29c8555d2
4 changed files with 55 additions and 20 deletions
+2 -3
View File
@@ -1,11 +1,10 @@
# $OpenBSD: Makefile,v 1.5 2020/03/29 09:54:58 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.6 2020/04/04 08:35:17 ajacoutot Exp $
COMMENT= library for encoding and decoding .avif files
GH_ACCOUNT= AOMediaCodec
GH_PROJECT= libavif
GH_TAGNAME= v0.6.2
REVISION= 0
GH_TAGNAME= v0.6.3
CATEGORIES= graphics
SHARED_LIBS= avif 1.0
+2 -2
View File
@@ -1,2 +1,2 @@
SHA256 (libavif-0.6.2.tar.gz) = 49UyNcqGkdIjVnFgdX85MLD5ucW7Ch8V673eBCsqGfo=
SIZE (libavif-0.6.2.tar.gz) = 2877947
SHA256 (libavif-0.6.3.tar.gz) = X7CliZMcti2GGBLtdRD1BmT0FCIi5cxQsqhxwohfVC4=
SIZE (libavif-0.6.3.tar.gz) = 2878362
@@ -1,15 +0,0 @@
$OpenBSD: patch-src_codec_dav1d_c,v 1.1 2020/03/29 09:54:58 ajacoutot Exp $
Set dav1dSettings.frame_size_limit to avoid OOM.
Index: src/codec_dav1d.c
--- src/codec_dav1d.c.orig
+++ src/codec_dav1d.c
@@ -201,5 +201,7 @@ avifCodec * avifCodecCreateDav1d(void)
codec->internal = (struct avifCodecInternal *)avifAlloc(sizeof(struct avifCodecInternal));
memset(codec->internal, 0, sizeof(struct avifCodecInternal));
dav1d_default_settings(&codec->internal->dav1dSettings);
+ // Set a maximum frame size limit to avoid OOM'ing fuzzers.
+ codec->internal->dav1dSettings.frame_size_limit = 16384 * 16384;
return codec;
}
@@ -0,0 +1,51 @@
$OpenBSD: patch-src_reformat_c,v 1.1 2020/04/04 08:35:17 ajacoutot Exp $
Fix clang warning (switch clamp to min).
Index: src/reformat.c
--- src/reformat.c.orig
+++ src/reformat.c
@@ -311,9 +311,9 @@ static avifResult avifImageYUV16ToRGB16Color(avifImage
uint32_t uvI = AVIF_MIN(i >> state->formatInfo.chromaShiftX, maxUVI);
// clamp incoming data to protect against bad LUT lookups
- const uint16_t unormY = AVIF_CLAMP(ptrY[i], 0, yuvMaxChannel);
- const uint16_t unormU = AVIF_CLAMP(ptrU[uvI], 0, yuvMaxChannel);
- const uint16_t unormV = AVIF_CLAMP(ptrV[uvI], 0, yuvMaxChannel);
+ const uint16_t unormY = AVIF_MIN(ptrY[i], yuvMaxChannel);
+ const uint16_t unormU = AVIF_MIN(ptrU[uvI], yuvMaxChannel);
+ const uint16_t unormV = AVIF_MIN(ptrV[uvI], yuvMaxChannel);
// Convert unorm to float
const float Y = unormFloatTableY[unormY];
@@ -357,7 +357,7 @@ static avifResult avifImageYUV16ToRGB16Mono(avifImage
for (uint32_t i = 0; i < image->width; ++i) {
// clamp incoming data to protect against bad LUT lookups
- const uint16_t unormY = AVIF_CLAMP(ptrY[i], 0, yuvMaxChannel);
+ const uint16_t unormY = AVIF_MIN(ptrY[i], yuvMaxChannel);
// Convert unorm to float
const float Y = unormFloatTableY[unormY];
@@ -408,9 +408,9 @@ static avifResult avifImageYUV16ToRGB8Color(avifImage
uint32_t uvI = AVIF_MIN(i >> state->formatInfo.chromaShiftX, maxUVI);
// clamp incoming data to protect against bad LUT lookups
- const uint16_t unormY = AVIF_CLAMP(ptrY[i], 0, yuvMaxChannel);
- const uint16_t unormU = AVIF_CLAMP(ptrU[uvI], 0, yuvMaxChannel);
- const uint16_t unormV = AVIF_CLAMP(ptrV[uvI], 0, yuvMaxChannel);
+ const uint16_t unormY = AVIF_MIN(ptrY[i], yuvMaxChannel);
+ const uint16_t unormU = AVIF_MIN(ptrU[uvI], yuvMaxChannel);
+ const uint16_t unormV = AVIF_MIN(ptrV[uvI], yuvMaxChannel);
// Convert unorm to float
const float Y = unormFloatTableY[unormY];
@@ -454,7 +454,7 @@ static avifResult avifImageYUV16ToRGB8Mono(avifImage *
for (uint32_t i = 0; i < image->width; ++i) {
// clamp incoming data to protect against bad LUT lookups
- const uint16_t unormY = AVIF_CLAMP(ptrY[i], 0, yuvMaxChannel);
+ const uint16_t unormY = AVIF_MIN(ptrY[i], yuvMaxChannel);
// Convert unorm to float
const float Y = unormFloatTableY[unormY];