Files
libxmp/test-dev/test_loader_starpack.c
AliceLR b7c1270e5d Fix StarTrekker Packer bugs and potential out-of-bounds writes.
* The StarTrekker Packer test now correctly scans the pattern table.
* The StarTrekker Packer loader now correctly divides the size of the
  pattern table by 4 to get the number of positions.
* The StarTrekker Packer loader now limits the number of unused
  patterns to prevent them from overflowing the pattern address table.
2021-01-05 23:08:10 -07:00

25 lines
516 B
C

#include "test.h"
TEST(test_loader_starpack)
{
xmp_context opaque;
struct xmp_module_info info;
FILE *f;
int ret;
f = fopen("data/format_starpack.data", "r");
opaque = xmp_create_context();
ret = xmp_load_module(opaque, "data/m/mod.startide_rising.StartrekkerPacker");
fail_unless(ret == 0, "module load");
xmp_get_module_info(opaque, &info);
ret = compare_module(info.mod, f);
fail_unless(ret == 0, "format not correctly loaded");
xmp_release_module(opaque);
xmp_free_context(opaque);
}
END_TEST