From ead5137379f0c51d043f06522cdadbb0a5fe4291 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: May 28 2021 04:13:31 +0000 Subject: import libwebp-1.0.0-3.el8_4 --- diff --git a/SOURCES/rhbz-1956829.patch b/SOURCES/rhbz-1956829.patch new file mode 100644 index 0000000..4eb544f --- /dev/null +++ b/SOURCES/rhbz-1956829.patch @@ -0,0 +1,15 @@ +diff --git a/src/dec/buffer_dec.c b/src/dec/buffer_dec.c +index 75eb3c4..3cd94eb 100644 +--- a/src/dec/buffer_dec.c ++++ b/src/dec/buffer_dec.c +@@ -74,7 +74,8 @@ + } else { // RGB checks + const WebPRGBABuffer* const buf = &buffer->u.RGBA; + const int stride = abs(buf->stride); +- const uint64_t size = MIN_BUFFER_SIZE(width, height, stride); ++ const uint64_t size = ++ MIN_BUFFER_SIZE(width * kModeBpp[mode], height, stride); + ok &= (size <= buf->size); + ok &= (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..e159adb --- /dev/null +++ b/SOURCES/rhbz-1956843.patch @@ -0,0 +1,19 @@ +diff --git a/src/dec/idec_dec.c b/src/dec/idec_dec.c +index a371ed7..258d15b 100644 +--- a/src/dec/idec_dec.c ++++ b/src/dec/idec_dec.c + +@@ -283,10 +283,8 @@ + + static VP8StatusCode IDecError(WebPIDecoder* const idec, VP8StatusCode error) { + if (idec->state_ == STATE_VP8_DATA) { +- VP8Io* const io = &idec->io_; +- if (io->teardown != NULL) { +- 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..590a800 --- /dev/null +++ b/SOURCES/rhbz-1956919.patch @@ -0,0 +1,36 @@ +diff --git a/src/utils/quant_levels_dec_utils.c b/src/utils/quant_levels_dec_utils.c +index 3818a78..f65b6cd 100644 +--- a/src/utils/quant_levels_dec_utils.c ++++ b/src/utils/quant_levels_dec_utils.c + +@@ -261,9 +261,15 @@ + + int WebPDequantizeLevels(uint8_t* const data, int width, int height, int stride, + int strength) { +- const int radius = 4 * strength / 100; ++ int radius = 4 * strength / 100; ++ + if (strength < 0 || strength > 100) return 0; + if (data == NULL || width <= 0 || height <= 0) return 0; // bad params ++ ++ // limit the filter size to not exceed the image dimensions ++ if (2 * radius + 1 > width) radius = (width - 1) >> 1; ++ if (2 * radius + 1 > height) radius = (height - 1) >> 1; ++ + if (radius > 0) { + SmoothParams p; + memset(&p, 0, sizeof(p)); +diff --git a/src/mux/muxread.c b/src/mux/muxread.c +index ef50dae..fbe9f05 100644 +--- a/src/mux/muxread.c ++++ b/src/mux/muxread.c + +@@ -138,6 +138,7 @@ + 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; + if (!MuxImageFinalize(wpi)) goto Fail; + wpi->is_partial_ = 0; // wpi is completely filled. + diff --git a/SPECS/libwebp.spec b/SPECS/libwebp.spec index ce62efa..bff6cbe 100644 --- a/SPECS/libwebp.spec +++ b/SPECS/libwebp.spec @@ -2,13 +2,16 @@ Name: libwebp Version: 1.0.0 -Release: 1%{?dist} +Release: 3%{?dist} URL: http://webmproject.org/ Summary: Library and tools for the WebP graphics format # Additional IPR is licensed as well. See PATENTS file for details License: BSD Source0: http://downloads.webmproject.org/releases/webp/%{name}-%{version}.tar.gz Source1: libwebp_jni_example.java +Patch0: rhbz-1956829.patch +Patch1: rhbz-1956843.patch +Patch2: rhbz-1956919.patch BuildRequires: libjpeg-devel BuildRequires: libpng-devel @@ -140,6 +143,9 @@ cp swig/*.jar swig/*.so %{buildroot}/%{_libdir}/%{name}-java/ %changelog +* Mon May 17 2021 Martin Stransky - 1.0.0-3 +- Added fixes for rhbz#1956829, rhbz#1956843, rhbz#1956919 + * Thu Apr 26 2018 Sandro Mani - 1.0.0-1 - Update to 1.0.0