[MPlayer-cvslog] r26446 - trunk/libmpdemux/demux_asf.c

uau subversion at mplayerhq.hu
Mon Apr 14 01:04:08 CEST 2008


Author: uau
Date: Mon Apr 14 01:04:07 2008
New Revision: 26446

Log:
demux_asf: Fix operator precedence in packet length check

Change (len & 3-1) to correct ((len & 3) - 1) in packet length check.
Also change "a - 1 < b" to simpler "a <= b".


Modified:
   trunk/libmpdemux/demux_asf.c

Modified: trunk/libmpdemux/demux_asf.c
==============================================================================
--- trunk/libmpdemux/demux_asf.c	(original)
+++ trunk/libmpdemux/demux_asf.c	Mon Apr 14 01:04:07 2008
@@ -46,7 +46,7 @@ static inline unsigned read_varlen(uint8
  * \param len lowest 2 bits indicate number of bytes to read
  */
 static inline int check_varlen(uint8_t *ptr, uint8_t *endptr, int len) {
-    return len&3 ? ptr + (1<<(len&3 - 1)) - 1 < endptr : 1;
+    return len&3 ? ptr + (1<<((len&3) - 1)) <= endptr : 1;
 }
 
 static void asf_descrambling(unsigned char **src,unsigned len, struct asf_priv* asf){



More information about the MPlayer-cvslog mailing list