-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
Closed
Labels
Milestone
Description
System Information
OpenCV 4.11.0
Detailed description
In the following code https://github.com/sturkmen72/opencv/blob/538b99f9f3e3b89cfdc363f8afc7ad4cf21b0ba0/modules/imgcodecs/src/grfmt_webp.cpp
/grfmt_webp.cpp)
bool WebPDecoder::readData(Mat &img)
{
...
if (m_has_animation)
{
uint8_t* buf;
int timestamp;
WebPAnimDecoderGetNext(anim_decoder.get(), &buf, ×tamp);
Mat tmp(Size(m_width, m_height), CV_8UC4, buf);
...
buf
and timestamp
can remain uninitialized if WebPAnimDecoderGetNext()
fails.
buf
should be checked before going any further.
Steps to reproduce
Compiling with VIsual studio raises a warning about potential use of uninitialized variable
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files (videos, images, onnx, etc)
sturkmen72