[FFmpeg-soc] [soc]: r5813 - mms/mmst.c

spyfeng subversion at mplayerhq.hu
Sun May 23 05:50:36 CEST 2010


Author: spyfeng
Date: Sun May 23 05:50:36 2010
New Revision: 5813

Log:
simplify return value checking in asf_header_parser().

Modified:
   mms/mmst.c

Modified: mms/mmst.c
==============================================================================
--- mms/mmst.c	Sun May 23 05:45:31 2010	(r5812)
+++ mms/mmst.c	Sun May 23 05:50:36 2010	(r5813)
@@ -431,13 +431,10 @@ static int asf_header_parser(MMSContext 
     p += sizeof(ff_asf_guid) + 14;
     while(end - p >= sizeof(ff_asf_guid) + 8) {
         uint64_t chunksize = AV_RL64(p + sizeof(ff_asf_guid));
-        if (!chunksize) {
-            dprintf("chunksize is zero!\n");
+        if (!chunksize || chunksize > end - p) {
+            dprintf("chunksize is exceptional value:%d!\n", chunksize);
             return -1;
         }
-        dprintf("chunksize is %d\n", chunksize);
-        if (chunksize > end - p)
-           return -1;
         if (!memcmp(p, ff_asf_file_header, sizeof(ff_asf_guid))) {
             /* read packet size */
             if (end - p > sizeof(ff_asf_guid) * 2 + 68) {


More information about the FFmpeg-soc mailing list