libavcodec/dxv.c:290: error: Uninitialized Value
  The value read from idx was never initialized.

libavcodec/dxv.c:290:17: 
288.         /* Copy two elements from a previous offset or from the input buffer */
289.         if (op) {
290.             if (idx > pos || (unsigned int)(pos - idx) + 2 > ctx->tex_size / 4)
                     ^
291.                 return AVERROR_INVALIDDATA;
292.             prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));

static int dxv_decompress_dxt5(AVCodecContext *avctx)
{
    DXVContext *ctx = avctx->priv_data;
    GetByteContext *gbc = &ctx->gbc;
    uint32_t value, op;
    int idx, prev, state = 0;
    int pos = 4;
    int run = 0;
    int probe, check;
    value = bytestream2_get_le32(gbc);
    AV_WL32(ctx->tex_data +  0, value);
    value = bytestream2_get_le32(gbc);
    AV_WL32(ctx->tex_data +  4, value);
    value = bytestream2_get_le32(gbc);
    AV_WL32(ctx->tex_data +  8, value);
    value = bytestream2_get_le32(gbc);
    AV_WL32(ctx->tex_data + 12, value);
    while (pos + 2 <= ctx->tex_size / 4) {
        if (run) {
            run--;
            prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
            AV_WL32(ctx->tex_data + 4 * pos, prev);
            pos++;
            prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
            AV_WL32(ctx->tex_data + 4 * pos, prev);
            pos++;
        } else {
            if (state == 0) {
                value = bytestream2_get_le32(gbc);
                state = 16;
            }
            op = value & 0x3;
            value >>= 2;
            state--;
            switch (op) {
            case 0:
                check = bytestream2_get_byte(gbc) + 1;
                if (check == 256) {
                    do {
                        probe = bytestream2_get_le16(gbc);
                        check += probe;
                    } while (probe == 0xFFFF);
                }
                while (check && pos + 4 <= ctx->tex_size / 4) {
                    prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
                    AV_WL32(ctx->tex_data + 4 * pos, prev);
                    pos++;
                    prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
                    AV_WL32(ctx->tex_data + 4 * pos, prev);
                    pos++;
                    prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
                    AV_WL32(ctx->tex_data + 4 * pos, prev);
                    pos++;
                    prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
                    AV_WL32(ctx->tex_data + 4 * pos, prev);
                    pos++;
                    check--;
                }
                continue;
                break;
            case 1:
                run = bytestream2_get_byte(gbc);
                if (run == 255) {
                    do {
                        probe = bytestream2_get_le16(gbc);
                        run += probe;
                    } while (probe == 0xFFFF);
                }
                prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
                AV_WL32(ctx->tex_data + 4 * pos, prev);
                pos++;
                prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));
                AV_WL32(ctx->tex_data + 4 * pos, prev);
                pos++;
                break;
            case 2:
                idx = 8 + bytestream2_get_le16(gbc);
                if (idx > pos || (unsigned int)(pos - idx) + 2 > ctx->tex_size / 4)
                    return AVERROR_INVALIDDATA;
                prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
                AV_WL32(ctx->tex_data + 4 * pos, prev);
                pos++;
                prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
                AV_WL32(ctx->tex_data + 4 * pos, prev);
                pos++;
                break;
            case 3:
                prev = bytestream2_get_le32(gbc);
                AV_WL32(ctx->tex_data + 4 * pos, prev);
                pos++;
                prev = bytestream2_get_le32(gbc);
                AV_WL32(ctx->tex_data + 4 * pos, prev);
                pos++;
                break;
            }
        }
        CHECKPOINT(4);
        if (pos + 2 > ctx->tex_size / 4)
            return AVERROR_INVALIDDATA;
        if (op) {
            if (idx > pos || (unsigned int)(pos - idx) + 2 > ctx->tex_size / 4)
                return AVERROR_INVALIDDATA;
            prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
            AV_WL32(ctx->tex_data + 4 * pos, prev);
            pos++;
            prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
            AV_WL32(ctx->tex_data + 4 * pos, prev);
            pos++;
        } else {
            CHECKPOINT(4);
            if (op && (idx > pos || (unsigned int)(pos - idx) + 2 > ctx->tex_size / 4))
                return AVERROR_INVALIDDATA;
            if (op)
                prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
            else
                prev = bytestream2_get_le32(gbc);
            AV_WL32(ctx->tex_data + 4 * pos, prev);
            pos++;
            CHECKPOINT(4);
            if (op)
                prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));
            else
                prev = bytestream2_get_le32(gbc);
            AV_WL32(ctx->tex_data + 4 * pos, prev);
            pos++;
        }
    }
    return 0;
}
['static int dxv_decompress_dxt5(AVCodecContext *avctx)\n{\n    DXVContext *ctx = avctx->priv_data;\n    GetByteContext *gbc = &ctx->gbc;\n    uint32_t value, op;\n    int idx, prev, state = 0;\n    int pos = 4;\n    int run = 0;\n    int probe, check;\n    value = bytestream2_get_le32(gbc);\n    AV_WL32(ctx->tex_data +  0, value);\n    value = bytestream2_get_le32(gbc);\n    AV_WL32(ctx->tex_data +  4, value);\n    value = bytestream2_get_le32(gbc);\n    AV_WL32(ctx->tex_data +  8, value);\n    value = bytestream2_get_le32(gbc);\n    AV_WL32(ctx->tex_data + 12, value);\n    while (pos + 2 <= ctx->tex_size / 4) {\n        if (run) {\n            run--;\n            prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));\n            AV_WL32(ctx->tex_data + 4 * pos, prev);\n            pos++;\n            prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));\n            AV_WL32(ctx->tex_data + 4 * pos, prev);\n            pos++;\n        } else {\n            if (state == 0) {\n                value = bytestream2_get_le32(gbc);\n                state = 16;\n            }\n            op = value & 0x3;\n            value >>= 2;\n            state--;\n            switch (op) {\n            case 0:\n                check = bytestream2_get_byte(gbc) + 1;\n                if (check == 256) {\n                    do {\n                        probe = bytestream2_get_le16(gbc);\n                        check += probe;\n                    } while (probe == 0xFFFF);\n                }\n                while (check && pos + 4 <= ctx->tex_size / 4) {\n                    prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));\n                    AV_WL32(ctx->tex_data + 4 * pos, prev);\n                    pos++;\n                    prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));\n                    AV_WL32(ctx->tex_data + 4 * pos, prev);\n                    pos++;\n                    prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));\n                    AV_WL32(ctx->tex_data + 4 * pos, prev);\n                    pos++;\n                    prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));\n                    AV_WL32(ctx->tex_data + 4 * pos, prev);\n                    pos++;\n                    check--;\n                }\n                continue;\n                break;\n            case 1:\n                run = bytestream2_get_byte(gbc);\n                if (run == 255) {\n                    do {\n                        probe = bytestream2_get_le16(gbc);\n                        run += probe;\n                    } while (probe == 0xFFFF);\n                }\n                prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));\n                AV_WL32(ctx->tex_data + 4 * pos, prev);\n                pos++;\n                prev = AV_RL32(ctx->tex_data + 4 * (pos - 4));\n                AV_WL32(ctx->tex_data + 4 * pos, prev);\n                pos++;\n                break;\n            case 2:\n                idx = 8 + bytestream2_get_le16(gbc);\n                if (idx > pos || (unsigned int)(pos - idx) + 2 > ctx->tex_size / 4)\n                    return AVERROR_INVALIDDATA;\n                prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));\n                AV_WL32(ctx->tex_data + 4 * pos, prev);\n                pos++;\n                prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));\n                AV_WL32(ctx->tex_data + 4 * pos, prev);\n                pos++;\n                break;\n            case 3:\n                prev = bytestream2_get_le32(gbc);\n                AV_WL32(ctx->tex_data + 4 * pos, prev);\n                pos++;\n                prev = bytestream2_get_le32(gbc);\n                AV_WL32(ctx->tex_data + 4 * pos, prev);\n                pos++;\n                break;\n            }\n        }\n        CHECKPOINT(4);\n        if (pos + 2 > ctx->tex_size / 4)\n            return AVERROR_INVALIDDATA;\n        if (op) {\n            if (idx > pos || (unsigned int)(pos - idx) + 2 > ctx->tex_size / 4)\n                return AVERROR_INVALIDDATA;\n            prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));\n            AV_WL32(ctx->tex_data + 4 * pos, prev);\n            pos++;\n            prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));\n            AV_WL32(ctx->tex_data + 4 * pos, prev);\n            pos++;\n        } else {\n            CHECKPOINT(4);\n            if (op && (idx > pos || (unsigned int)(pos - idx) + 2 > ctx->tex_size / 4))\n                return AVERROR_INVALIDDATA;\n            if (op)\n                prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));\n            else\n                prev = bytestream2_get_le32(gbc);\n            AV_WL32(ctx->tex_data + 4 * pos, prev);\n            pos++;\n            CHECKPOINT(4);\n            if (op)\n                prev = AV_RL32(ctx->tex_data + 4 * (pos - idx));\n            else\n                prev = bytestream2_get_le32(gbc);\n            AV_WL32(ctx->tex_data + 4 * pos, prev);\n            pos++;\n        }\n    }\n    return 0;\n}']