[MPlayer-cvslog] r37812 - trunk/libmpdemux/aviheader.c

reimar subversion at mplayerhq.hu
Fri Feb 26 22:03:49 CET 2016


Author: reimar
Date: Fri Feb 26 22:03:49 2016
New Revision: 37812

Log:
aviheader: check fread result when reading index file.

Modified:
   trunk/libmpdemux/aviheader.c

Modified: trunk/libmpdemux/aviheader.c
==============================================================================
--- trunk/libmpdemux/aviheader.c	Fri Feb 26 21:52:36 2016	(r37811)
+++ trunk/libmpdemux/aviheader.c	Fri Feb 26 22:03:49 2016	(r37812)
@@ -611,12 +611,12 @@ if (index_file_load) {
     mp_msg(MSGT_HEADER,MSGL_ERR, MSGTR_MPDEMUX_AVIHDR_CantReadIdxFile, index_file_load, strerror(errno));
     goto gen_index;
   }
-  fread(&magic, 6, 1, fp);
-  if (strncmp(magic, "MPIDX1", 6)) {
+  if (fread(&magic, 6, 1, fp) != 1 ||
+      strncmp(magic, "MPIDX1", 6) ||
+      fread(&priv->idx_size, sizeof(priv->idx_size), 1, fp) != 1) {
     mp_msg(MSGT_HEADER,MSGL_ERR, MSGTR_MPDEMUX_AVIHDR_NotValidMPidxFile, index_file_load);
     goto gen_index;
   }
-  fread(&priv->idx_size, sizeof(priv->idx_size), 1, fp);
   priv->idx=calloc(priv->idx_size,sizeof(AVIINDEXENTRY));
   if (!priv->idx) {
     mp_msg(MSGT_HEADER,MSGL_ERR, MSGTR_MPDEMUX_AVIHDR_FailedMallocForIdxFile, index_file_load);


More information about the MPlayer-cvslog mailing list