From 9cd9f3fcda6258f659bc9f92946cbd2abef28ada Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Jun 07 2021 10:05:10 +0000 Subject: import libwebp-0.3.0-10.el7_9 --- diff --git a/SOURCES/rhbz-1956829.patch b/SOURCES/rhbz-1956829.patch new file mode 100644 index 0000000..e31f16f --- /dev/null +++ b/SOURCES/rhbz-1956829.patch @@ -0,0 +1,26 @@ +diff -up libwebp-0.3.0/src/dec/buffer.c.old libwebp-0.3.0/src/dec/buffer.c +--- libwebp-0.3.0/src/dec/buffer.c.old 2021-05-17 12:37:43.268514218 +0200 ++++ libwebp-0.3.0/src/dec/buffer.c 2021-05-17 12:38:27.435859390 +0200 +@@ -35,6 +35,11 @@ static int IsValidColorspace(int webp_cs + return (webp_csp_mode >= MODE_RGB && webp_csp_mode < MODE_LAST); + } + ++// strictly speaking, the very last (or first, if flipped) row ++// doesn't require padding. ++#define MIN_BUFFER_SIZE(WIDTH, HEIGHT, STRIDE) \ ++ ((uint64_t)(STRIDE) * ((HEIGHT) - 1) + (WIDTH)) ++ + static VP8StatusCode CheckDecBuffer(const WebPDecBuffer* const buffer) { + int ok = 1; + const WEBP_CSP_MODE mode = buffer->colorspace; +@@ -64,7 +69,9 @@ static VP8StatusCode CheckDecBuffer(cons + } + } else { // RGB checks + const WebPRGBABuffer* const buf = &buffer->u.RGBA; +- const uint64_t size = (uint64_t)buf->stride * height; ++ const int stride = abs(buf->stride); ++ const uint64_t size = ++ MIN_BUFFER_SIZE(width * kModeBpp[mode], height, stride); + ok &= (size <= buf->size); + ok &= (buf->stride >= width * kModeBpp[mode]); + ok &= (buf->rgba != NULL); diff --git a/SOURCES/rhbz-1956843.patch b/SOURCES/rhbz-1956843.patch new file mode 100644 index 0000000..d2a8f8e --- /dev/null +++ b/SOURCES/rhbz-1956843.patch @@ -0,0 +1,16 @@ +diff -up libwebp-0.3.0/src/dec/idec.c.rhbz-1956843 libwebp-0.3.0/src/dec/idec.c +--- libwebp-0.3.0/src/dec/idec.c.rhbz-1956843 2021-05-17 10:44:13.670402403 +0200 ++++ libwebp-0.3.0/src/dec/idec.c 2021-05-17 10:45:31.035742375 +0200 +@@ -241,10 +241,8 @@ static void RestoreContext(const MBConte + + static VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) { + if (idec->state_ == STATE_VP8_DATA) { +- VP8Io* const io = &idec->io_; +- if (io->teardown) { +- io->teardown(io); +- } ++ // Synchronize the thread, clean-up and check for errors. ++ VP8ExitCritical((VP8Decoder*)idec->dec_, &idec->io_); + } + idec->state_ = STATE_ERROR; + return error; diff --git a/SOURCES/rhbz-1956919.patch b/SOURCES/rhbz-1956919.patch new file mode 100644 index 0000000..d7c7df8 --- /dev/null +++ b/SOURCES/rhbz-1956919.patch @@ -0,0 +1,11 @@ +diff -up libwebp-0.3.0/src/mux/muxread.c.rhbz-1956919 libwebp-0.3.0/src/mux/muxread.c +--- libwebp-0.3.0/src/mux/muxread.c.rhbz-1956919 2021-05-27 09:52:07.953914353 +0200 ++++ libwebp-0.3.0/src/mux/muxread.c 2021-05-27 09:52:59.325863123 +0200 +@@ -118,6 +118,7 @@ static int MuxImageParse(const WebPChunk + wpi->is_partial_ = 1; // Waiting for a VP8 chunk. + break; + case WEBP_CHUNK_IMAGE: ++ if (wpi->img_ != NULL) goto Fail; // Only 1 image chunk allowed. + if (ChunkSetNth(&subchunk, &wpi->img_, 1) != WEBP_MUX_OK) goto Fail; + wpi->is_partial_ = 0; // wpi is completely filled. + break; diff --git a/SPECS/libwebp.spec b/SPECS/libwebp.spec index e2e2d69..45e8526 100644 --- a/SPECS/libwebp.spec +++ b/SPECS/libwebp.spec @@ -1,7 +1,7 @@ %global _hardened_build 1 Name: libwebp Version: 0.3.0 -Release: 7%{?dist} +Release: 10%{?dist} Group: Development/Libraries URL: http://webmproject.org/ Summary: Library and tools for the WebP graphics format @@ -11,6 +11,9 @@ Source0: http://webp.googlecode.com/files/%{name}-%{version}.tar.gz Source1: libwebp_jni_example.java Patch0: libwebp-0.3.0-endian-check.patch Patch1: libwebp-0.3.0-endian-check2.patch +Patch2: rhbz-1956829.patch +Patch3: rhbz-1956843.patch +Patch4: rhbz-1956919.patch BuildRequires: libjpeg-devel libpng-devel libtool swig BuildRequires: giflib-devel BuildRequires: libtiff-devel @@ -62,6 +65,9 @@ Java bindings for libwebp. %setup -q %patch0 -p1 -b .endian %patch1 -p1 -b .endian2 +%patch2 -p1 -b .rhbz-1956829 +%patch3 -p1 -b .rhbz-1956843 +%patch4 -p1 -b .rhbz-1956919 %build mkdir -p m4 @@ -123,7 +129,11 @@ cp swig/*.jar swig/*.so %{buildroot}/%{_libdir}/%{name}-java/ %doc libwebp_jni_example.java %{_libdir}/%{name}-java/ + %changelog +* Mon May 17 2021 Martin Stransky - 0.3.0-10 +- Added fixes for rhbz#1956829, rhbz#1956843, rhbz#1956919 + * Tue Feb 21 2017 Martin Stransky - 0.3.0-7 - Added libwebp dependency to libwebp-tools