Files
opencv-MIRROR/modules/imgcodecs
pbkx 7dc5622cc0 Merge pull request #30282 from pbkx:fix-animation-encoding-params-4x
imgcodecs: validate animation encoding parameter lists - #30282

`imwriteanimation()` and `imencodeanimation()` forward encoding parameters without the structural checks used by all the ordinary image encoding APIs.

This PR adds the same key/value-pair and maximum-count check before the functions call the animation encoder. It also adds a test that checks odd-length and over-limit parameter lists are rejected while empty and valid parameter lists still encode and decode correctly.

Related work: #22830 and #27769.

### Pull Request Readiness Checklist

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
2026-10-14 13:37:21 +03:00
..