test/libmpv_encode: check fread return value

Fixes warning with clang
This commit is contained in:
llyyr 2024-07-07 08:54:20 +05:30 committed by Kacper Michajłow
parent 6c59b0272b
commit f89d0d48bc
1 changed files with 3 additions and 3 deletions

View File

@ -94,11 +94,11 @@ static void check_output(FILE *fp)
if (size < 100)
fail("did not encode anything\n");
char magic[4] = {0};
char magic[4];
fseek(fp, 0, SEEK_SET);
fread(magic, sizeof(magic), 1, fp);
size_t ret = fread(magic, sizeof(magic), 1, fp);
static const char ebml_magic[] = {26, 69, 223, 163};
if (memcmp(magic, ebml_magic, 4) != 0)
if (ret != 1 || memcmp(magic, ebml_magic, sizeof(magic)) != 0)
fail("output was not Matroska\n");
puts("output file ok");