/*
* LZW decoder
- * Copyright (c) 2003 Fabrice Bellard.
- * Copyright (c) 2006 Konstantin Shishkov.
+ * Copyright (c) 2003 Fabrice Bellard
+ * Copyright (c) 2006 Konstantin Shishkov
*
* This file is part of FFmpeg.
*
*/
/**
- * @file lzw.c
+ * @file
* @brief LZW decoding routines
* @author Fabrice Bellard
* Modified for use in TIFF by Konstantin Shishkov
/**
* Initialize LZW decoder
- * @param s LZW context
+ * @param p LZW context
* @param csize initial code size in bits
* @param buf input data
* @param buf_size input data size
{
struct LZWState *s = (struct LZWState *)p;
- if(csize < 1 || csize > LZW_MAXBITS)
+ if(csize < 1 || csize >= LZW_MAXBITS)
return -1;
/* read buffer */
s->pbuf = buf;
* NOTE: the algorithm here is inspired from the LZW GIF decoder
* written by Steven A. Bennett in 1987.
*
- * @param s LZW context
+ * @param p LZW context
* @param buf output buffer
* @param len number of bytes to decode
* @return number of bytes decoded