summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* GetBackwardReferences: fail on alloc error1.2.1James Zern2022-04-061-9/+10
| | | | | | | | | | previously failures in the call to VP8LBackwardReferencesTraceBackwards() would be ignored which, though it wouldn't result in a crash, would produce non-deterministic output Change-Id: Id9890a60883c3270ec75e968506d46eea32b76d4 (cherry picked from commit e3cfafaf719c2e163d3548d7a415da96fdff714f) (cherry picked from commit 20ef03ee351d4ff03fc5ff3ec4804a879d1b9d5c)
* BackwardReferencesHashChainDistanceOnly: fix segfault on OOMJames Zern2022-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | change CostManager to calloc to avoid frees on undefined pointer values in CostManagerClear() should the cost_model allocation succeed, but the cost_manager allocation fail since: v0.5.0-93-g3e023c17 Speed-up BackwardReferencesHashChainDistanceOnly. Tested: for i in `seq 1 639`; do export MALLOC_FAIL_AT=$i ./examples/cwebp -m 6 -q 100 -lossless jpeg_file done Bug: webp:565 Change-Id: I376d81e6f41eb73529053e9e30c142b4b4f6b45b (cherry picked from commit a828a59b49d2e3fbc40dc42a6ee6426cd0f2c9dc) (cherry picked from commit dd80bb43431c222762be47fd92f8a37e032bc2c0)
* VP8LEncodeStream: fix segfault on OOMJames Zern2022-04-061-3/+8
| | | | | | | | | | | | | | | | | | | | initialize bw_side before calling EncoderAnalyze() & EncoderInit() which may fail; previously this would cause a free of an invalid pointer in VP8LBitWriterWipeOut(). since at least: v0.6.0-120-gf8c2ac15 Multi-thread the lossless cruncher. Tested: for i in `seq 1 639`; do export MALLOC_FAIL_AT=$i ./examples/cwebp -m 6 -q 100 -lossless jpeg_file done Bug: webp:565 Change-Id: I1c95883834b6e4b13aee890568ce3bad0f4266f0 (cherry picked from commit fe153fae98a3fe4626ff537ec8d5f4477cec5739) (cherry picked from commit ddd65f0d19bc6a3acbc48e49d315140ccf099b9a)
* alpha_processing_neon.c: fix 0x01... typoJames Zern2022-03-081-1/+1
| | | | | | | one instance was overlong leading to a int64->uint32 conversion warning Change-Id: I56d5ab75d89960c79293f62cd489d7ab519bbc34 (cherry picked from commit 03d12190552c3e95d31aa00303f28a8a2f813bdd)
* alpha_processing_neon.c: fix Dispatch/ExtractAlpha_NEONJames Zern2022-03-031-2/+4
| | | | | | | | | | | the trailing width % 8 bytes would clear the upper bytes of alpha_mask as they're done one at a time since: 49d0280d NEON: implement several alpha-processing functions Change-Id: Iff76c0af3094597285a6aa6ed032b345f9856aae (cherry picked from commit 924e7ca6540d1ac0a2b1b92ee094a64391de0c09)
* Fix lossless encoding for MIPS.Vincent Rabaud2022-03-021-4/+4
| | | | | | Bug: webp:558 Change-Id: I3d3ddb64ed26a8d8ff5664664c5f20f6eadfeb4f (cherry picked from commit e4cbcdd2b5ff33a64f97fe49d67fb56f915657e8)
* update ChangeLogv1.2.1James Zern2021-07-291-0/+3
| | | | Change-Id: I12c2b718e99087201a57f7ab7cc4c16374e205f6
* fuzzer/*: normalize src/ includesJames Zern2021-07-295-8/+8
| | | | | | | | this uses the format introduced to some files in: cc3577e9 fuzzer/*: use src/ based include paths Change-Id: I9b5cbeadbb9d54d1e89f474a6e479a5eb3175ed7 (cherry picked from commit c5bc36243ab5dc4351fb5de5f7047cf621114143)
* fix indentJames Zern2021-07-283-25/+25
| | | | | | | | after: 277d3074 Fix size_t overflow in WebPRescalerInit Change-Id: I9adf7f01f28ddd54305512762e2ed28713282966 (cherry picked from commit d2caaba435f0e819e5e43b5de678b6b1a266a323)
* update ChangeLogv1.2.1-rc2James Zern2021-07-261-0/+96
| | | | Change-Id: Ia3faaafd42eb96e257415e1cf9c7ceb69f851147
* dsp/*: use WEBP_HAVE_* to determine Init availabilityJames Zern2021-07-2613-41/+53
| | | | | | | | | | | | | | | after: ece18e55 dsp.h: respect --disable-sse2/sse4.1/neon WEBP_USE_* will be set when a module is targeting a particular instruction set, e.g., sse4.1, and not overridden if WEBP_HAVE_SSE41 is set, as previously this would ignore the case where the instruction set was disabled via config.h and the HAVE macro was unset. dsp.h not ensures WEBP_HAVE_* are set when WEBP_USE_* to cover cases where the files are built without config.h. Change-Id: Ia1c2dcf4100cc1081d968acb6e085e2a1768ece6 (cherry picked from commit 1fe3162541ab2f5ce69aca2e2b593fab60520d34)
* update NEWSJames Zern2021-07-201-0/+12
| | | | | Bug: webp:521 Change-Id: Ic52942bcbfa8aa8e41b95991c0663698884fa8a8
* bump version to 1.2.1James Zern2021-07-2015-32/+32
| | | | | | | | | | | | | | | libwebp{,decoder} - 1.2.1 libwebp libtool - 8.2.1 libwebpdecoder libtool - 4.2.1 mux - 1.2.1 libtool - 3.7.0 demux - 1.2.1 libtool - 2.8.0 Bug: webp:521 Change-Id: I098e3e9df698baa275dea85315b9136e565e9971
* update AUTHORSJames Zern2021-07-202-0/+5
| | | | | Bug: webp:521 Change-Id: Ie2decd9def1a718a01aa1e381ef8f284d18fe279
* Merge "libwebp/CMake: Add <BUILD_INTERFACE> to webp incl" into mainYannis Guyon2021-07-191-4/+6
|\
| * libwebp/CMake: Add <BUILD_INTERFACE> to webp inclYannis Guyon2021-07-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | This way target_link_libraries(my_target PUBLIC webp) is enough, no need to add include directories explicitly for the public headers such as src/webp/decode.h. This matches the /usr/include/webp/decode.h installation folder path prefix (#include "webp/decode.h"). See https://bugs.chromium.org/p/webp/issues/detail?id=532 The target_include_directories() calls for cwebp, dwebp etc. may be unnecessary now and may be removed in another patch. Change-Id: I2c85218920ffc35ebec23e0dd239f71e29add23b
* | dsp.h: respect --disable-sse2/sse4.1/neonJames Zern2021-07-172-5/+10
|/ | | | | | | previously this would be overridden if the instruction set was enabled via -msse4.1, __aarch64__, etc. Change-Id: I51e87a7da7589c6093d260b848ab41d89ec7b990
* wicdec: support alpha from WebP WIC decoderJames Zern2021-07-161-0/+5
| | | | | | | | | the container check may not be strictly necessary now that the alpha check has matured and the library will detect usable alpha, but it's safer to fix this case first before making larger changes. Bug: webp:533 Change-Id: I2e1ba42156970d579a52bd183707a037e65fd900
* Merge "alpha_processing: fix visual studio warnings" into mainJames Zern2021-07-136-49/+59
|\
| * alpha_processing: fix visual studio warningsJames Zern2021-07-136-49/+59
| | | | | | | | | | | | | | | | | | | | | | | | similar to '* const', __restrict needs to be included in the declaration to avoid warnings like: src\dsp\alpha_processing.c(429): warning C4028: formal parameter 1 different from declaration this change also moves WEBP_RESTRICT to dsp.h to avoid a circular dependency between it and utils.h which already includes dsp.h Change-Id: Ib070d358a372e76fae4be5445ab288940b9baac0
* | Merge "cpu.cmake: fix compiler flag detection w/3.17.0+" into mainJames Zern2021-07-091-0/+7
|\ \ | |/ |/|
| * cpu.cmake: fix compiler flag detection w/3.17.0+James Zern2021-07-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Between 3.17.0 and 3.18.2 check_cxx_compiler_flag() sets a normal variable at parent scope while check_cxx_source_compiles() continues to set an internal cache variable, so we unset both to avoid the failure / success state persisting between checks. This was fixed in 3.18.3 [1], but regressed shortly afterward [2]; currently seen with 3.20.0 installed via homebrew. [1] https://gitlab.kitware.com/cmake/cmake/-/issues/21207 [2] 90dead024c CheckCompilerFlag: unified way to check compiler flags per language Change-Id: I57282f89b07a9cfd85aca7569380f7d115c0b3cf
* | Merge changes I593adf92,If20675e7,Ifac68eac into mainPascal Massimino2021-07-081-34/+51
|\ \ | | | | | | | | | | | | | | | | | | * changes: configure: enable libwebpmux by default configure: add informational notices when disabling binaries configure: move lib flag checks before binaries
| * | configure: enable libwebpmux by defaultJames Zern2021-07-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | this will provide the main libraries and their supporting examples by default if external library requirements (e.g., gif2webp+libgif) are met. Bug: webp:501 Change-Id: I593adf9222698e2dc5a2199909949c7fea1273b2
| * | configure: add informational notices when disabling binariesJames Zern2021-07-031-1/+17
| | | | | | | | | | | | | | | | | | | | | this better documents the requirements for some of the examples. Bug: webp:501 Change-Id: If20675e71ebf2c1d9bb51d65a05fd4e9f339ac5a
| * | configure: move lib flag checks before binariesJames Zern2021-07-031-33/+33
| |/ | | | | | | | | | | | | | | | | | | this ensures the defaults are set properly before testing conditions for enabling certain binaries. previously anim_diff would need --enable-libwebpdemux to be explicitly added though it defaults to enabled. Bug: webp:501 Change-Id: Ifac68eac7096b39e98d0025e07a37b0be3d32c0a
* | alpha_processing*: use WEBP_RESTRICT qualifierJames Zern2021-07-074-37/+54
|/ | | | | | | this helps both auto-vectorization in the C code and the optimized code generation Change-Id: Ide570d6be45125ffef7248bdc40e9eb08f00e832
* Merge "WebPConfig.config.in: correct WEBP_INCLUDE_DIRS" into mainJames Zern2021-06-291-1/+1
|\
| * WebPConfig.config.in: correct WEBP_INCLUDE_DIRSJames Zern2021-06-251-1/+1
| | | | | | | | | | | | | | | | | | this should be the full path to the installed headers to be added to the client code's search path, e.g., /usr/local/include when including <webp/decode.h> Bug: webp:509 Change-Id: I756249876d8de421c9a33513221fb635157560ef
* | Merge "bit_reader_inl_utils: uniformly apply WEBP_RESTRICT" into mainPascal Massimino2021-06-281-3/+4
|\ \
| * | bit_reader_inl_utils: uniformly apply WEBP_RESTRICTJames Zern2021-06-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | this can help with some aliasing issues with some versions of clang/gcc, similar to: 3e265136 Add WEBP_RESTRICT & use it in VP8BitReader Change-Id: I863e53cc9d707c9a4b21373ca743c3089aed012e
* | | rescaler.c: fix alignmentSkal2021-06-281-3/+3
|/ / | | | | | | Change-Id: Ifc2d0d301280baaa403fcdf8722fce42d28a1853
* | Fix size_t overflow in WebPRescalerInitSkal2021-06-255-67/+92
|/ | | | | | we need to surface potential error up, so lot of signature changes. Change-Id: I7c11a46c4542564d06417203cd1158754e30a9e4
* advanced_api_fuzzer: add extreme config value coverageJames Zern2021-06-231-29/+46
| | | | | | | | this enables cases that might trigger overflows, but increases the risk of OOM and timeouts Bug: chromium:1196850 Change-Id: I317b5109525646731e762faa3c34ed28a27595dc
* anim_encode.c,cosmetics: normalize indentJames Zern2021-06-231-1/+1
| | | | Change-Id: Iba33a60850ec481b73b7eccb67492e7f1dd3d10e
* anim_encode: Fix encoded_frames_[] overflowJames Zern2021-06-231-1/+8
| | | | | | | | | | | | Check encoded_frames_ count and call FlushFrames if necessary after IncreasePreviousDuration. Avoids an overflow in encoded_frames_[] with -kmax 0 and an assertion failure related to the previous and keyframe durations when a frame is forced in this way. Based on patch by tomwei7g <at> gmail Bug: webp:518 Change-Id: Idef685e6c06a67d48fcdc048265ca0e672a01263
* CMake: set CMP0072 to NEWChristopher Degawa2021-06-211-0/+4
| | | | | | | Silences CMake's warning and uses GLVND, which still works for linux Signed-off-by: Christopher Degawa <ccom@randomderp.com> Change-Id: Iadd173b41c4fbcdff9fe512f9a7dbf70a6d95bcd
* define WEBP_RESTRICT for MSVCJames Zern2021-06-181-8/+15
| | | | | | | | | | __restrict is supported: https://docs.microsoft.com/en-us/cpp/cpp/extension-restrict?view=msvc-160 + add a comment and simplify the __restrict__ check, clang defines __GNUC__ Change-Id: I76d8d3cbd1b730f492c6fc0b2114f1897886b677
* Add WEBP_RESTRICT & use it in VP8BitReaderClement Courbet2021-06-182-1/+11
| | | | | | | Marking the `VP8BitReader` as `__restrict__` helps the compiler generate better code avoiding issues related to aliasing (re-loads/stores). Change-Id: Ib7178f57e27e5f40572efc3e567cdf994ea6d928
* vp8l_dec::ProcessRows: fix int overflow in multiplyJames Zern2021-06-161-1/+2
| | | | | | | | use 64-bit math in calculating the offsets as they may exceed 32-bits when scaling Bug: chromium:1196850 Change-Id: I6a484fc4dded6f6c4b82346ef145eb69c1477b3c
* CMake: add WEBP_BUILD_LIBWEBPMUXChristopher Degawa2021-06-161-1/+8
| | | | | | | | Adds an additional option similar to configure's --enable-libwebpmux to toggle building libwebpmux separate from the binaries Signed-off-by: Christopher Degawa <ccom@randomderp.com> Change-Id: I0443b84eea36d86791e2e421a6fc0070879a7bef
* CMakeLists.txt: rm libwebpmux dep from anim_{diff,dump}James Zern2021-06-161-2/+0
| | | | Change-Id: Ic293affca5a3e17afbfcda5e96eb101d005621b8
* Init{RGB,YUV}Rescaler: fix a few more int overflowsJames Zern2021-06-141-2/+4
| | | | | | | | | | | | promote out_width to size_t before multiplying src/dec/io_dec.c:301:30: runtime error: signed integer overflow: 2 * 1224167500 cannot be represented in type 'int' #0 0x55fd9e8de2bd in InitYUVRescaler src/dec/io_dec.c:301:30 #1 0x55fd9e8de2bd in CustomSetup src/dec/io_dec.c:571:54 Bug: chromium:1196850 Change-Id: I70d0aac1b5eef163a3f353b721fb9ab561e02040
* rescaler_utils: set max valid scaled w/h to INT_MAX/2James Zern2021-06-141-1/+3
| | | | | | | | this will avoid the potential for some integer overflows in rescaler calculations Bug: chromium:1196850 Change-Id: Iaa09f5d6b888b39aaeb2154d470279620362d6eb
* utils.h: add SizeOverflow()James Zern2021-06-146-9/+13
| | | | | | this normalizes the 'size != (size_t)size' checks in the libraries. Change-Id: I1e8ccd0d3697266f23911ecf0f7a546f011befde
* Export/EmitRescaledRowsRGBA: fix pointer offset int overflowJames Zern2021-06-141-3/+4
| | | | | | | | | in Export increment the dst pointer, but in EmitRescaledRowsRGBA use 64-bit math as the number of output lines is variable and may still overflow when incrementing. Bug: chromium:1196850 Change-Id: I5c65b875894ee9da0fef1e24d27e507171800c4a
* Init{RGB,YUV}Rescaler: fix int overflows in multiplicationjzern@google.com2021-06-101-14/+22
| | | | | | | | | | | | with large sizes the intermediate calculations may exceed 32-bits src/dec/io_dec.c:491:17: runtime error: signed integer overflow: 3 * 788529152 cannot be represented in type 'int' #0 0x557a3ad972b2 in InitRGBRescaler src/dec/io_dec.c:491:17 #1 0x557a3ad972b2 in CustomSetup src/dec/io_dec.c:563:29 Bug: chromium:1196850 Change-Id: Iaf2e8a6de9481dfea31dcd7fccb2d4eca767bddf
* WebPFlipBuffer: fix integer overflowjzern@google.com2021-06-101-2/+2
| | | | | | | | | | | | with large scale values the offset to the end of the buffer may exceed 32-bits range. src/dec/buffer_dec.c:158:39: runtime error: signed integer overflow: 2 * 1275068416 cannot be represented in type 'int' #0 0x56444802bea5 in WebPFlipBuffer src/dec/buffer_dec.c:158:39 Bug: chromium:1196850 Change-Id: I08c8b69ada5d5dd3e9bf2b9006dffa0c5f2103a5
* utils: allow MALLOC_LIMIT to indicate a maxJames Zern2021-06-071-1/+4
| | | | | | | | | | in addition to checking the environment for "MALLOC_LIMIT"; the environment will still take precedence. this is in preparation for adding extreme config value coverage to advanced_api_fuzzer Bug: chromium:1196850 Change-Id: Ibe22f5e39e030a422fd6e383269bde35252d3fae
* WebPRescalerImportRowExpand_C: promote some vals before multiplyJames Zern2021-06-071-3/+4
| | | | | | | | | | | | avoids integer overflow in extreme cases: src/dsp/rescaler.c:45:32: runtime error: signed integer overflow: 129 * 16777215 cannot be represented in type 'int' #0 0x556bde3538e3 in WebPRescalerImportRowExpand_C src/dsp/rescaler.c:45:32 #1 0x556bde357465 in RescalerImportRowExpand_SSE2 src/dsp/rescaler_sse2.c:56:5 ... Bug: chromium:1196850 Change-Id: I4f923807f106713e113f3eec62a1d1c346066345