function CreateMultiImageFromGLTexture(const Texture: GLuint;
var Images: TDynImageDataArray; MipLevels: LongInt; OverrideFormat: TImageFormat): Boolean;
var
I, Width, Height, ExistingLevels: LongInt;
begin
FreeImagesInArray(Images);
SetLength(Images, 0);
Result := False;
if Byte(glIsTexture(Texture)) = GL_TRUE then
begin
// Check if desired mipmap level count is valid
glBindTexture(GL_TEXTURE_2D, Texture);
if MipLevels <= 0 then
MipLevels := GetNumMipMapLevels(Width, Height); //<- Here it tries to access uninitialized memory (Line 849)
SetLength(Images, MipLevels);
if MipLevels <= 0 then
begin
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, @Width);
glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, @Height);
MipLevels := GetNumMipMapLevels(Width, Height);
end;
Page created in 0.031 seconds with 20 queries.