Revision adf6640c libavcodec/lzwenc.c

View differences:

libavcodec/lzwenc.c
232 232
    for (i = 0; i < insize; i++) {
233 233
        uint8_t c = *inbuf++;
234 234
        int code = findCode(s, c, code_prefix);
235
        if (s->tab[code].hash_prefix != LZW_PREFIX_FREE) {
236
            code_prefix = s->tab[code].code;
237
        } else {
235
        if (s->tab[code].hash_prefix == LZW_PREFIX_FREE) {
238 236
            writeCode(s, code_prefix);
239 237
            addCode(s, c, code_prefix, code);
240
            code_prefix = s->tab[hash(0, c)].code;
238
            code= hash(0, c);
241 239
        }
240
        code_prefix = s->tab[code].code;
242 241
        if (s->tabsize >= s->maxcode - 1) {
243 242
            clearTable(s);
244 243
        }

Also available in: Unified diff