From 6edce30c23e46d3e75193764994ee87b57678da3 Mon Sep 17 00:00:00 2001 From: michelerenzullo Date: Mon, 20 Jun 2022 19:42:02 +0200 Subject: [PATCH] updated CUBEParser with buffer mode --- XMPConverter/XMPconverter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/XMPConverter/XMPconverter.cpp b/XMPConverter/XMPconverter.cpp index 17fc5fb..5a14c01 100644 --- a/XMPConverter/XMPconverter.cpp +++ b/XMPConverter/XMPconverter.cpp @@ -175,14 +175,14 @@ string get_file_contents(string filename) { void encode(string path, string& outFileName) { - char title[100]; + char title[100] = { 0 }; int32_t input_size; double* samples_1 = NULL; - int32_t result = CUBEParser(path.c_str(), title, &input_size, &samples_1); + int32_t result = CUBEParser(path.data(), 1, title, &input_size, &samples_1); switch (result) { - case -1: printf("Size error - not a CUBE file\n"); break; - case -2: printf("Error - no data lut\n"); break; + case -1: printf("Error - no data lut\n"); break; + case -2: printf("Size error - not a CUBE file\n"); break; //case -3: printf("Error - input file not found\n"); break; not needed already checked before call encode case 0: printf("- test encoding back -\nTITLE: %s\nSIZE: %d\n", (options.title.empty()) ? title : options.title.c_str(), input_size);