Matteo Bruni (@Mystral) commented about dlls/d3dx9_36/surface.c:
{ memcpy(dst_row, src_row, row_pitch); }
src_row += row_pitch;
}
image->image_buf = image->pixels = img_buf;
return D3D_OK;
+exit:
- if (img_buf && (image->image_buf != img_buf))
free(img_buf);
We could `realloc()` the buffer here to release the memory for the temporary row, if decoding was successful.