[PATCH 2/3] windowscodecs: Initialize block data in DdsDecoder_Dds_GetFrame().
Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> --- dlls/windowscodecs/ddsformat.c | 61 ++++++++++++++++++++++++++-------- 1 file changed, 47 insertions(+), 14 deletions(-)
+ if (ref == 0) { + HeapFree(GetProcessHeap(), 0, This); + HeapFree(GetProcessHeap(), 0, This->data); + } This is dereferencing a pointer after it's been freed. The loop in GetFrame seems unnecessarily complicated. If the size of each item in the array is the same, we don't really need to calculate it for each one, do we?
Yeah, you are correct. I'll fix it in next version. On 6/5/20 11:50 PM, Esme Povirk (they/them) wrote:
+ if (ref == 0) { + HeapFree(GetProcessHeap(), 0, This); + HeapFree(GetProcessHeap(), 0, This->data); + }
This is dereferencing a pointer after it's been freed.
The loop in GetFrame seems unnecessarily complicated. If the size of each item in the array is the same, we don't really need to calculate it for each one, do we?
participants (2)
-
Esme Povirk (they/them) -
Ziqing Hui