summaryrefslogtreecommitdiffstats
path: root/libhb/hb.c
diff options
context:
space:
mode:
authorSean McGovern <[email protected]>2016-06-30 11:56:46 -0400
committerSean McGovern <[email protected]>2016-07-01 14:07:30 -0400
commitb7645e7842703d52c44feaa85cfb3c490e09c8dc (patch)
treefff45a18b5dab225397f326e10b00e2c61158d60 /libhb/hb.c
parent4275507a21562299ed6b27cebc40c7308fd594a8 (diff)
libhb: don't ignore the return result from fread()
Diffstat (limited to 'libhb/hb.c')
-rw-r--r--libhb/hb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/libhb/hb.c b/libhb/hb.c
index abcfa72eb..d84fece27 100644
--- a/libhb/hb.c
+++ b/libhb/hb.c
@@ -696,7 +696,13 @@ hb_buffer_t * hb_read_preview(hb_handle_t * h, hb_title_t *title, int preview)
for (hh = 0; hh < h; hh++)
{
- fread(data, w, 1, file);
+ if (fread(data, w, 1, file) < w)
+ {
+ hb_error( "hb_read_preview: Failed to read line %d from %s" , hh, filename );
+ hb_buffer_close(&buf);
+ break;
+ }
+
data += stride;
}
}