[FFmpeg-devel] [PATCH] Fix confusing assert in lzwenc.c
Daniel Verkamp
daniel
Mon Feb 9 06:42:23 CET 2009
Hi,
Attached fixes an assert in libavcodec/lzwenc.c:
1. The right side of the && made no sense at all - comparing
s->maxbits with itself? Presumably this should be LZW_MAXBITS as in
patch.
2. The left side of the && was confusing (to me at least) because of
the order in which it was written, although both forms are equivalent.
Thanks,
-- Daniel Verkamp
-------------- next part --------------
>From 7a56c9f0b664b59a9a18c33c88205c702c9ef3ce Mon Sep 17 00:00:00 2001
From: Daniel Verkamp <daniel at drv.nu>
Date: Sun, 8 Feb 2009 23:39:32 -0600
Subject: [PATCH] Fix confusing assert
---
libavcodec/lzwenc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/libavcodec/lzwenc.c b/libavcodec/lzwenc.c
index d174acd..4565b22 100644
--- a/libavcodec/lzwenc.c
+++ b/libavcodec/lzwenc.c
@@ -203,7 +203,7 @@ void ff_lzw_encode_init(LZWEncodeState * s, uint8_t * outbuf, int outsize, int m
s->maxbits = maxbits;
init_put_bits(&s->pb, outbuf, outsize);
s->bufsize = outsize;
- assert(9 <= s->maxbits && s->maxbits <= s->maxbits);
+ assert(s->maxbits >= 9 && s->maxbits <= LZW_MAXBITS);
s->maxcode = 1 << s->maxbits;
s->output_bytes = 0;
s->last_code = LZW_PREFIX_EMPTY;
--
1.6.1.1
More information about the ffmpeg-devel
mailing list