mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-01 07:40:26 +02:00
afl-fuzz
This commit is contained in:
@ -2,9 +2,9 @@ set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
set(IRREXAMPLES
|
||||
# removed
|
||||
LoadTexture
|
||||
)
|
||||
if(UNIX)
|
||||
if(FALSE)
|
||||
list(APPEND IRREXAMPLES AutomatedTest)
|
||||
endif()
|
||||
|
||||
|
29
examples/LoadTexture/main.cpp
Normal file
29
examples/LoadTexture/main.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
#include <irrlicht.h>
|
||||
#include <iostream>
|
||||
|
||||
using namespace irr;
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
return 1;
|
||||
|
||||
SIrrlichtCreationParameters p;
|
||||
p.DriverType = video::EDT_NULL;
|
||||
p.WindowSize = core::dimension2du(640, 480);
|
||||
p.LoggingLevel = ELL_DEBUG;
|
||||
|
||||
auto *device = createDeviceEx(p);
|
||||
if (!device)
|
||||
return 1;
|
||||
auto *driver = device->getVideoDriver();
|
||||
|
||||
while (__AFL_LOOP(10000)) {
|
||||
auto *tex = driver->getTexture(argv[1]);
|
||||
if (tex)
|
||||
driver->removeTexture(tex);
|
||||
}
|
||||
|
||||
device->drop();
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user