summaryrefslogtreecommitdiff
path: root/ffmpeg/libavcodec/lzwenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg/libavcodec/lzwenc.c')
-rw-r--r--ffmpeg/libavcodec/lzwenc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ffmpeg/libavcodec/lzwenc.c b/ffmpeg/libavcodec/lzwenc.c
index 7e30765..d5a07bc 100644
--- a/ffmpeg/libavcodec/lzwenc.c
+++ b/ffmpeg/libavcodec/lzwenc.c
@@ -111,7 +111,7 @@ static inline int hashOffset(const int head)
*/
static inline void writeCode(LZWEncodeState * s, int c)
{
- assert(0 <= c && c < 1 << s->bits);
+ av_assert2(0 <= c && c < 1 << s->bits);
s->put_bits(&s->pb, s->bits, c);
}
@@ -207,7 +207,7 @@ void ff_lzw_encode_init(LZWEncodeState *s, uint8_t *outbuf, int outsize,
s->maxbits = maxbits;
init_put_bits(&s->pb, outbuf, outsize);
s->bufsize = outsize;
- assert(s->maxbits >= 9 && s->maxbits <= LZW_MAXBITS);
+ av_assert0(s->maxbits >= 9 && s->maxbits <= LZW_MAXBITS);
s->maxcode = 1 << s->maxbits;
s->output_bytes = 0;
s->last_code = LZW_PREFIX_EMPTY;
@@ -262,6 +262,9 @@ int ff_lzw_encode_flush(LZWEncodeState *s,
if (s->last_code != -1)
writeCode(s, s->last_code);
writeCode(s, s->end_code);
+ if (s->mode == FF_LZW_GIF)
+ s->put_bits(&s->pb, 1, 0);
+
lzw_flush_put_bits(&s->pb);
s->last_code = -1;