kbingham / libcamera

libcamera - Making complex cameras easy. This is a personal fork, please use the upstream repository at https://git.libcamera.org/libcamera/libcamera.git/
https://libcamera.org
Other
173 stars 69 forks source link

is there an bug: viewfinder_gl.cpp:391:25 #51

Closed tmsd2001 closed 2 years ago

tmsd2001 commented 2 years ago

../src/qcam/viewfinder_gl.cpp:391:25: error: ‘offset’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  391 |   .arg(offset, 0, 'f', 1));
kbingham commented 2 years ago

Can you supply a patch to the libcamera mailing list please? or report this on bugs.libcamera.org ?

kbingham commented 2 years ago

(It would be good to know what version of compiler and distro you are using, as I would expect to have hit this in our compiler matrix)

tmsd2001 commented 2 years ago

ok, I have created a BUG in Bugzilla. The Problem is

double offset;

for my purposes I could use:

double offset = 0;
switch (colorSpace.range) {
    case libcamera::ColorSpace::Range::Full:
        offset = 0.0;
        break;

    case libcamera::ColorSpace::Range::Limited:
        offset = 16.0;

        for (unsigned int i = 0; i < 3; ++i)
            yuv2rgb[i] *= 255.0 / 219.0;
        for (unsigned int i = 4; i < 9; ++i)
            yuv2rgb[i] *= 255.0 / 224.0;
        break;
    }

that probably no one of the cases happened and the variable then NaN.

kbingham commented 2 years ago

Looks like someone else is already working on a fix too: https://patchwork.libcamera.org/patch/17280/ Closing as duplicate for now.