Skip to content

TLN_SetRenderTarget with a larger pitch causes heap buffer overflow (segfault) #126

@alvinhochun

Description

@alvinhochun

For example, if we do the following:

TLN_Init(240, 160, 4, 128, 0);
TLN_SetRenderTarget(framebuffer, 4 * 256); // texture width must be power-of-2

Then when calling TLN_UpdateFrame we get a heap buffer overflow at:

memset(engine->priority, 0, engine->framebuffer.pitch);

The buffer is allocated at:

context->priority = (uint32_t*)malloc(context->framebuffer.pitch);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions