mirror of
https://github.com/ultravideo/uvg266.git
synced 2024-11-27 11:24:05 +00:00
you know what, fread returns number of elements, not bytes
This commit is contained in:
parent
c89477bb41
commit
4deed04eb9
|
@ -92,8 +92,8 @@ int process_rdcosts(FILE *in, FILE *out)
|
||||||
if (n_read == 0) {
|
if (n_read == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (feof(in) || n_read < sizeof(uint32_t) * 2) {
|
if (feof(in) || n_read < 2) {
|
||||||
fprintf(stderr, "Unexpected EOF when reading header, managed still to read %u bytes\n", n_read);
|
fprintf(stderr, "Unexpected EOF when reading header, managed still to read %u u32's\n", n_read);
|
||||||
rv = 1;
|
rv = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -105,8 +105,8 @@ int process_rdcosts(FILE *in, FILE *out)
|
||||||
|
|
||||||
size_sqrt = 1 << (ilog2(size) >> 1);
|
size_sqrt = 1 << (ilog2(size) >> 1);
|
||||||
n_read = fread(buf, sizeof(int16_t), size, in);
|
n_read = fread(buf, sizeof(int16_t), size, in);
|
||||||
if (n_read != size * sizeof(int16_t)) {
|
if (n_read != size) {
|
||||||
fprintf(stderr, "Unexpected EOF when reading block, managed still to read %u bytes\n", n_read);
|
fprintf(stderr, "Unexpected EOF when reading block, managed still to read %u i16's\n", n_read);
|
||||||
rv = 1;
|
rv = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,8 +87,8 @@ int process_rdcosts(FILE *in, FILE *out, const double *mat)
|
||||||
if (n_read == 0) {
|
if (n_read == 0) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (feof(in) || n_read < sizeof(uint32_t) * 2) {
|
if (feof(in) || n_read < 2) {
|
||||||
fprintf(stderr, "Unexpected EOF when reading header, managed still to read %u bytes\n", n_read);
|
fprintf(stderr, "Unexpected EOF when reading header, managed still to read %u u32's\n", n_read);
|
||||||
rv = 1;
|
rv = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
@ -101,8 +101,8 @@ int process_rdcosts(FILE *in, FILE *out, const double *mat)
|
||||||
size_sqrt = 1 << (ilog2(size) >> 1);
|
size_sqrt = 1 << (ilog2(size) >> 1);
|
||||||
|
|
||||||
n_read = fread(buf, sizeof(int16_t), size, in);
|
n_read = fread(buf, sizeof(int16_t), size, in);
|
||||||
if (n_read != size * sizeof(int16_t)) {
|
if (n_read != size) {
|
||||||
fprintf(stderr, "Unexpected EOF when reading block, managed still to read %u bytes\n", n_read);
|
fprintf(stderr, "Unexpected EOF when reading block, managed still to read %u i16's\n", n_read);
|
||||||
rv = 1;
|
rv = 1;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue