diff options
author | uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-04-13 23:04:07 +0000 |
---|---|---|
committer | uau <uau@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2008-04-13 23:04:07 +0000 |
commit | c9e6af5949b89600742254b837fd419e26ed2a98 (patch) | |
tree | fc03cc6c7266c67dd3655508568364ca8a2cdf36 | |
parent | 93699de7052418051d8b99d18305d753a5ac4d2c (diff) |
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".
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26446 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libmpdemux/demux_asf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libmpdemux/demux_asf.c b/libmpdemux/demux_asf.c index b23e0f2c4e..40614f3745 100644 --- a/libmpdemux/demux_asf.c +++ b/libmpdemux/demux_asf.c @@ -46,7 +46,7 @@ static inline unsigned read_varlen(uint8_t **ptr, int len, int def) { * \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){ |