mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-04-07 20:06:01 +00:00
pam: fixed data read failure
By incorporating Coverity complains, return value from fread was incorrectly evaluated - returned nmemb=1 of size instead of size in bytes. Reversed the order for convenience (to show actual number of bytes, not only that 0 members were read).
This commit is contained in:
@@ -174,7 +174,7 @@ bool pam_read(const char *filename, struct pam_metadata *info, unsigned char **d
|
||||
fclose(file);
|
||||
return false;
|
||||
}
|
||||
size_t bytes_read = fread((char *) *data, datalen, 1, file);
|
||||
size_t bytes_read = fread((char *) *data, 1, datalen, file);
|
||||
if (bytes_read != datalen) {
|
||||
fprintf(stderr, "Unable to load PAM/PNM data from file - read %zu B, expected %zu B: %s\n",
|
||||
bytes_read, datalen, strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user