add test/data for video support : windows compilation issue

This commit is contained in:
Mohamed Ali Chebbi 2023-02-03 08:11:24 +01:00
parent f5e731cd38
commit f9b94d3172

View File

@ -801,15 +801,16 @@ Image::UniquePtr newRiffInstance(BasicIo::UniquePtr io, bool /*create*/) {
}
bool isRiffType(BasicIo& iIo, bool advance) {
const unsigned char RiffVideoId[4] = {'R', 'I', 'F', 'F'};
byte buf[WORD];
iIo.read(buf, WORD);
constexpr int len = 4;
const unsigned char RiffVideoId[len] = {'R', 'I', 'F', 'F'};
byte buf[len];
iIo.read(buf, len);
if (iIo.error() || iIo.eof()) {
return false;
}
bool matched = (memcmp(buf, RiffVideoId, WORD) == 0);
bool matched = (memcmp(buf, RiffVideoId, len) == 0);
if (!advance || !matched) {
iIo.seek(-WORD, BasicIo::cur);
iIo.seek(-1*len, BasicIo::cur);
}
return matched;
}