Coder Social home page Coder Social logo

luxonis / depthai-bootloader-shared Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 21.0 46 KB

Shared code and data for depthai-bootloader

Home Page: https://docs.luxonis.com/

License: MIT License

C++ 86.90% C 13.10%
ai cv depth depth-camera disparity embedded spatial stereo

depthai-bootloader-shared's People

Contributors

alex-luxonis avatar diablodale avatar jonngai avatar themarpe avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

depthai-bootloader-shared's Issues

`dai::Response:*::success` not initialized, some code paths then test garbage mem values

Three classes within dai::Response:* have a success member that is later directly tested in branching like if(resp.success) ...
However, there are multiple codepaths in which success is never initialized and therefore holds a random garbage value.
Which then leads to failures in branching.

Easy fix. The classes should set a default init of 0 aka false.

Setup

  • all
  • depthai-bootloader-shared main and depthai-core main

Repro

Found during code cleanup I'm in process doing. Here is one example...

The branch which tests if(resp.success) https://github.com/luxonis/depthai-core/blob/c49cd08cb1cad7d526ca2c2a2b561f0dcfa7020d/src/device/DeviceBootloader.cpp#L691

    Response::GetBootloaderConfig resp; // doesn't initialize anything to any value
    receiveResponse(resp); // fail on first line of func and returns `false`
    if(resp.success) { // therefore `success` was never initialized and if() tests random garbage value

Expected

Initialize all member fields. https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#c41-a-constructor-should-create-a-fully-initialized-object

Fix

I have a PR forthcoming, fix for this specific case is easy.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.