libavcodec/kgv1dec.c:91: error: Uninitialized Value
  The value read from offsets[_] was never initialized.

libavcodec/kgv1dec.c:91:21: 
89.                 count = (code & 0x3FF) + 3;
90. 
91.                 if (offsets[oidx] < 0) {
                        ^
92.                     if (buf_end - 3 < buf)
93.                         break;

static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)
{
    const uint8_t *buf = avpkt->data;
    const uint8_t *buf_end = buf + avpkt->size;
    KgvContext * const c = avctx->priv_data;
    int offsets[7];
    uint16_t *out, *prev;
    int outcnt = 0, maxcnt;
    int w, h, i;
    if (avpkt->size < 2)
        return -1;
    w = (buf[0] + 1) * 8;
    h = (buf[1] + 1) * 8;
    buf += 2;
    if (avcodec_check_dimensions(avctx, w, h))
        return -1;
    if (w != avctx->width || h != avctx->height)
        avcodec_set_dimensions(avctx, w, h);
    maxcnt = w * h;
    out = av_realloc(c->cur, w * h * 2);
    if (!out)
        return -1;
    c->cur = out;
    prev = av_realloc(c->prev, w * h * 2);
    if (!prev)
        return -1;
    c->prev = prev;
    for (i = 0; i < 7; i++)
        offsets[i] = -1;
    while (outcnt < maxcnt && buf_end - 2 > buf) {
        int code = AV_RL16(buf);
        buf += 2;
        if (!(code & 0x8000)) {
            out[outcnt++] = code;
        } else {
            int count;
            uint16_t *inp;
            if ((code & 0x6000) == 0x6000) {
                int oidx = (code >> 10) & 7;
                int start;
                count = (code & 0x3FF) + 3;
                if (offsets[oidx] < 0) {
                    if (buf_end - 3 < buf)
                        break;
                    offsets[oidx] = AV_RL24(buf);
                    buf += 3;
                }
                start = (outcnt + offsets[oidx]) % maxcnt;
                if (maxcnt - start < count)
                    break;
                inp = prev + start;
            } else {
                int offset = (code & 0x1FFF) + 1;
                if (!(code & 0x6000)) {
                    count = 2;
                } else if ((code & 0x6000) == 0x2000) {
                    count = 3;
                } else {
                    if (buf_end - 1 < buf)
                        break;
                    count = 4 + *buf++;
                }
                if (outcnt < offset)
                    break;
                inp = out + outcnt - offset;
            }
            if (maxcnt - outcnt < count)
                break;
            for (i = 0; i < count; i++)
                out[outcnt++] = inp[i];
        }
    }
    if (outcnt - maxcnt)
        av_log(avctx, AV_LOG_DEBUG, "frame finished with %d diff\n", outcnt - maxcnt);
    c->pic.data[0]     = (uint8_t *)c->cur;
    c->pic.linesize[0] = w * 2;
    *data_size = sizeof(AVFrame);
    *(AVFrame*)data = c->pic;
    FFSWAP(uint16_t *, c->cur, c->prev);
    return avpkt->size;
}
['static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt)\n{\n    const uint8_t *buf = avpkt->data;\n    const uint8_t *buf_end = buf + avpkt->size;\n    KgvContext * const c = avctx->priv_data;\n    int offsets[7];\n    uint16_t *out, *prev;\n    int outcnt = 0, maxcnt;\n    int w, h, i;\n    if (avpkt->size < 2)\n        return -1;\n    w = (buf[0] + 1) * 8;\n    h = (buf[1] + 1) * 8;\n    buf += 2;\n    if (avcodec_check_dimensions(avctx, w, h))\n        return -1;\n    if (w != avctx->width || h != avctx->height)\n        avcodec_set_dimensions(avctx, w, h);\n    maxcnt = w * h;\n    out = av_realloc(c->cur, w * h * 2);\n    if (!out)\n        return -1;\n    c->cur = out;\n    prev = av_realloc(c->prev, w * h * 2);\n    if (!prev)\n        return -1;\n    c->prev = prev;\n    for (i = 0; i < 7; i++)\n        offsets[i] = -1;\n    while (outcnt < maxcnt && buf_end - 2 > buf) {\n        int code = AV_RL16(buf);\n        buf += 2;\n        if (!(code & 0x8000)) {\n            out[outcnt++] = code;\n        } else {\n            int count;\n            uint16_t *inp;\n            if ((code & 0x6000) == 0x6000) {\n                int oidx = (code >> 10) & 7;\n                int start;\n                count = (code & 0x3FF) + 3;\n                if (offsets[oidx] < 0) {\n                    if (buf_end - 3 < buf)\n                        break;\n                    offsets[oidx] = AV_RL24(buf);\n                    buf += 3;\n                }\n                start = (outcnt + offsets[oidx]) % maxcnt;\n                if (maxcnt - start < count)\n                    break;\n                inp = prev + start;\n            } else {\n                int offset = (code & 0x1FFF) + 1;\n                if (!(code & 0x6000)) {\n                    count = 2;\n                } else if ((code & 0x6000) == 0x2000) {\n                    count = 3;\n                } else {\n                    if (buf_end - 1 < buf)\n                        break;\n                    count = 4 + *buf++;\n                }\n                if (outcnt < offset)\n                    break;\n                inp = out + outcnt - offset;\n            }\n            if (maxcnt - outcnt < count)\n                break;\n            for (i = 0; i < count; i++)\n                out[outcnt++] = inp[i];\n        }\n    }\n    if (outcnt - maxcnt)\n        av_log(avctx, AV_LOG_DEBUG, "frame finished with %d diff\\n", outcnt - maxcnt);\n    c->pic.data[0]     = (uint8_t *)c->cur;\n    c->pic.linesize[0] = w * 2;\n    *data_size = sizeof(AVFrame);\n    *(AVFrame*)data = c->pic;\n    FFSWAP(uint16_t *, c->cur, c->prev);\n    return avpkt->size;\n}']