mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-08-20 09:57:10 +00:00
first patch of UB
This commit is contained in:
parent
d36433cafc
commit
5265eef759
|
|
@ -4111,7 +4111,7 @@ void CMinecraftApp::loadStringTable()
|
||||||
{
|
{
|
||||||
byteArray locFile = m_mediaArchive->getFile(localisationFile);
|
byteArray locFile = m_mediaArchive->getFile(localisationFile);
|
||||||
m_stringTable = new StringTable(locFile.data, locFile.length);
|
m_stringTable = new StringTable(locFile.data, locFile.length);
|
||||||
delete locFile.data;
|
delete[] locFile.data;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -60,11 +60,19 @@ void StitchedTexture::freeFrameTextures()
|
||||||
|
|
||||||
StitchedTexture::~StitchedTexture()
|
StitchedTexture::~StitchedTexture()
|
||||||
{
|
{
|
||||||
for(AUTO_VAR(it, frames->begin()); it != frames->end(); ++it)
|
// 4jcraft added null check, in PreStitchedTextures::stitch(), than ::loadUVs()
|
||||||
{
|
// all new SimpleIcons deriving from StitchedIcons are calling the
|
||||||
delete *it;
|
// constructor which does frames = NULL
|
||||||
|
// so the program breaks on delete oldClock in ::loadUVs()
|
||||||
|
// but scince "frames" is never allocated (StitchedTexture::init())
|
||||||
|
// not called, frames was never called (only the constructor)
|
||||||
|
if(frames) {
|
||||||
|
for(AUTO_VAR(it, frames->begin()); it != frames->end(); ++it)
|
||||||
|
{
|
||||||
|
delete *it;
|
||||||
|
}
|
||||||
|
delete frames;
|
||||||
}
|
}
|
||||||
delete frames;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StitchedTexture::initUVs(float U0, float V0, float U1, float V1)
|
void StitchedTexture::initUVs(float U0, float V0, float U1, float V1)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "MemoryTracker.h"
|
|
||||||
class ByteBuffer;
|
class ByteBuffer;
|
||||||
class IntBuffer;
|
class IntBuffer;
|
||||||
class FloatBuffer;
|
class FloatBuffer;
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ public:
|
||||||
static const int IS_ALPHA_CUT_OUT = 4;
|
static const int IS_ALPHA_CUT_OUT = 4;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
virtual ~Icon() {} // added by 4jcraft, needed for abstract class
|
||||||
|
|
||||||
virtual int getX() const = 0;
|
virtual int getX() const = 0;
|
||||||
virtual int getY() const = 0;
|
virtual int getY() const = 0;
|
||||||
virtual int getWidth() const = 0;
|
virtual int getWidth() const = 0;
|
||||||
|
|
|
||||||
6
debug.sh
Executable file
6
debug.sh
Executable file
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
meson compile -C build && \
|
||||||
|
cd build/Minecraft.Client/ && \
|
||||||
|
gdb -tui ./Minecraft.Client && \
|
||||||
|
cd ../..
|
||||||
Loading…
Reference in a new issue