VirtualBox

Ignore:
Timestamp:
Jan 5, 2015 10:59:26 PM (10 years ago)
Author:
vboxsync
Message:

VMSVGA3d/constant_heap_init: Don't trash the heap if the input (constant_count) is bogus (0).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/shaderlib/glsl_shader.c

    r53277 r53740  
    50525052static BOOL constant_heap_init(struct constant_heap *heap, unsigned int constant_count)
    50535053{
     5054#ifndef VBOX
    50545055    SIZE_T size = (constant_count + 1) * sizeof(*heap->entries) + constant_count * sizeof(*heap->positions);
    50555056    void *mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
     5057#else
     5058    SIZE_T size;
     5059    void *mem;
     5060
     5061    /* Don't trash the heap if the input is bogus. */
     5062    if (constant_count == 0)
     5063        constant_count = 1;
     5064
     5065    size = (constant_count + 1) * sizeof(*heap->entries) + constant_count * sizeof(*heap->positions);
     5066    mem = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
     5067#endif
    50565068
    50575069    if (!mem)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette