Commit b1d571f1 authored by Martin Storsjö's avatar Martin Storsjö

tools: Store return values from fread() in a size_t

In annexb_read, the res variable was used both for the return
from fread() (which is size_t, unsigned) and from leb128 (which
returns a signed int); remove the return value assignment
altogether as it wasn't used.
parent 4aa735b2
Pipeline #4427 passed with stages
in 6 minutes and 28 seconds
......@@ -103,7 +103,7 @@ static int annexb_read(AnnexbInputContext *const c, Dav1dData *const data) {
if (!ptr) return -1;
c->temporal_unit_size -= len + res;
c->frame_unit_size -= len + res;
if ((res = fread(ptr, len, 1, c->f)) != 1) {
if (fread(ptr, len, 1, c->f) != 1) {
fprintf(stderr, "Failed to read frame data: %s\n", strerror(errno));
dav1d_data_unref(data);
return -1;
......
......@@ -55,7 +55,7 @@ static int64_t rl64(const uint8_t *const p) {
static int ivf_open(IvfInputContext *const c, const char *const file,
unsigned fps[2], unsigned *const num_frames)
{
int res;
size_t res;
uint8_t hdr[32];
memset(c, 0, sizeof(*c));
......@@ -97,7 +97,7 @@ static int ivf_open(IvfInputContext *const c, const char *const file,
static int ivf_read(IvfInputContext *const c, Dav1dData *const buf) {
uint8_t data[8];
uint8_t *ptr;
int res;
size_t res;
const int64_t off = ftello(c->f);
if ((res = fread(data, 4, 1, c->f)) != 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment