diff --git a/.gitignore b/.gitignore index 25a7384..5761abc 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1 @@ *.o -*.exe diff --git a/compat/compat_snprintf.c b/compat/compat_snprintf.c index 40734a6..00336a0 100644 --- a/compat/compat_snprintf.c +++ b/compat/compat_snprintf.c @@ -24,8 +24,9 @@ #ifdef _MSC_VER #include - +#if _MSC_VER >= 1900 #include /* added for _vsnprintf_s and _vscprintf on VS2015 and VS2017 */ +#endif #include #if _MSC_VER < 1800 diff --git a/formats/libchdr/huffman.c b/formats/libchdr/huffman.c index 04b0300..dd041a7 100644 --- a/formats/libchdr/huffman.c +++ b/formats/libchdr/huffman.c @@ -294,7 +294,10 @@ enum huffman_error huffman_import_tree_huffman(struct huffman_decoder* decoder, /* make sure we ended up with the right number */ if (curcode != decoder->numcodes) + { + delete_huffman_decoder(smallhuff); return HUFFERR_INVALID_DATA; + } /* assign canonical codes for all nodes based on their code lengths */ error = huffman_assign_canonical_codes(decoder);