Skip to content

[BUG]libcamera-apps Options::Parse quirks #898

@matswebjorn

Description

@matswebjorn

I'm using libcamera-apps-v1.7.0 in an application to make still images, and found some quirks than perhaps needs some code updates.

The Options:Parse(int argc, char *argv[]) API doesn't say that the first parameter will always be discarted as it is assumed to contain the application name as will be the case when Options:Parse() is called from an applications main().

But, if it is called from inside some application, then the argv vector is created by the application. It would therefore be nice if this at least is documented in options.hpp and options_still.hpp.

If Options:Parse(int argc, char *argv[]) is called with argc = 0, then libcamera crashes with a message 'cannot create std::vector larger than max_size()'. It seems like there is no check on argc that it is > 0 before it is decremented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions