Created
July 24, 2020 18:49
-
-
Save Sembiance/d9fdbefe40feae39ee700d1b168e23bb to your computer and use it in GitHub Desktop.
Test abydos crash
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place in current working directory: https://telparia.com/fileFormatSamples/image/SPRITESCO.ABK | |
// Compile with: gcc -I/usr/include/cairo -I/usr/include/abydos -lm -lcairo -labydos-0.2 -o test test.c | |
// Run as: ./test | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <assert.h> | |
#include <abydos.h> | |
#include <cairo.h> | |
int main(int argc, char ** argv) | |
{ | |
abydos_t * ar; | |
cairo_surface_t * surface; | |
ar = abydos_create("image/x-amos-spritebank"); | |
if(!ar) | |
exit(EXIT_FAILURE); | |
if(abydos_from_file(ar, "SPRITESCO.ABK")!=0) | |
exit(EXIT_FAILURE); | |
surface = abydos_get_image_surface(ar); | |
abydos_destroy(ar); | |
if(cairo_surface_write_to_png(surface, "out.png")!=CAIRO_STATUS_SUCCESS) | |
{ | |
cairo_surface_destroy(surface); | |
exit(EXIT_FAILURE); | |
} | |
cairo_surface_destroy(surface); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment