[MPlayer-cvslog] r37727 - trunk/libmpdemux/aviheader.c
reimar
subversion at mplayerhq.hu
Sun Feb 14 15:09:26 CET 2016
Author: reimar
Date: Sun Feb 14 15:09:26 2016
New Revision: 37727
Log:
aviheader: check fread result instead of feof.
That is more reliable, simpler and fixes
a Coverity warning.
Modified:
trunk/libmpdemux/aviheader.c
Modified: trunk/libmpdemux/aviheader.c
==============================================================================
--- trunk/libmpdemux/aviheader.c Sun Feb 14 15:04:13 2016 (r37726)
+++ trunk/libmpdemux/aviheader.c Sun Feb 14 15:09:26 2016 (r37727)
@@ -623,8 +623,7 @@ if (index_file_load) {
for (i=0; i<priv->idx_size;i++) {
AVIINDEXENTRY *idx=priv->idx + i;
- fread(idx, sizeof(AVIINDEXENTRY), 1, fp);
- if (feof(fp)) {
+ if (fread(idx, 1, sizeof(*idx), fp) != sizeof(*idx)) {
mp_msg(MSGT_HEADER,MSGL_ERR, MSGTR_MPDEMUX_AVIHDR_PrematureEOF, index_file_load);
free(priv->idx);
priv->idx_size = 0;
More information about the MPlayer-cvslog
mailing list