Skip to content

CGDisplayMode::all_display_modes segmentation fault #319

@ghost

Description

Calling this function twice in a row will crash the program. I think the issue is that the implementation is creating a CGDisplayMode by taking a pointer to the display mode returned by CGDisplayCopyAllDisplayModes, but the array is freed when the function returns. I believe there is a double-free happening here. Adding a CGDisplayModeRetain call might solve the issue. I'm confused by the macros that this library uses, so I'm not sure that this is the correct solution however.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions