libavformat/nutdec.c:217: error: Uninitialized Value
  The value read from tmp was never initialized.

libavformat/nutdec.c:217:9: 
215. 
216.     nut->version = ffio_read_varlen(bc);
217.     if (tmp < NUT_MIN_VERSION && tmp > NUT_MAX_VERSION) {
             ^
218.         av_log(s, AV_LOG_ERROR, "Version %"PRId64" not supported.\n",
219.                tmp);

static int decode_main_header(NUTContext *nut)
{
    AVFormatContext *s = nut->avf;
    AVIOContext *bc    = s->pb;
    uint64_t tmp, end;
    unsigned int stream_count;
    int i, j, count;
    int tmp_stream, tmp_mul, tmp_pts, tmp_size, tmp_res, tmp_head_idx;
    end  = get_packetheader(nut, bc, 1, MAIN_STARTCODE);
    end += avio_tell(bc);
    nut->version = ffio_read_varlen(bc);
    if (tmp < NUT_MIN_VERSION && tmp > NUT_MAX_VERSION) {
        av_log(s, AV_LOG_ERROR, "Version %"PRId64" not supported.\n",
               tmp);
        return AVERROR(ENOSYS);
    }
    GET_V(stream_count, tmp > 0 && tmp <= NUT_MAX_STREAMS);
    nut->max_distance = ffio_read_varlen(bc);
    if (nut->max_distance > 65536) {
        av_log(s, AV_LOG_DEBUG, "max_distance %d\n", nut->max_distance);
        nut->max_distance = 65536;
    }
    GET_V(nut->time_base_count, tmp > 0 && tmp < INT_MAX / sizeof(AVRational));
    nut->time_base = av_malloc(nut->time_base_count * sizeof(AVRational));
    for (i = 0; i < nut->time_base_count; i++) {
        GET_V(nut->time_base[i].num, tmp > 0 && tmp < (1ULL << 31));
        GET_V(nut->time_base[i].den, tmp > 0 && tmp < (1ULL << 31));
        if (av_gcd(nut->time_base[i].num, nut->time_base[i].den) != 1) {
            av_log(s, AV_LOG_ERROR, "time base invalid\n");
            return AVERROR_INVALIDDATA;
        }
    }
    tmp_pts      = 0;
    tmp_mul      = 1;
    tmp_stream   = 0;
    tmp_head_idx = 0;
    for (i = 0; i < 256;) {
        int tmp_flags  = ffio_read_varlen(bc);
        int tmp_fields = ffio_read_varlen(bc);
        if (tmp_fields > 0)
            tmp_pts = get_s(bc);
        if (tmp_fields > 1)
            tmp_mul = ffio_read_varlen(bc);
        if (tmp_fields > 2)
            tmp_stream = ffio_read_varlen(bc);
        if (tmp_fields > 3)
            tmp_size = ffio_read_varlen(bc);
        else
            tmp_size = 0;
        if (tmp_fields > 4)
            tmp_res = ffio_read_varlen(bc);
        else
            tmp_res = 0;
        if (tmp_fields > 5)
            count = ffio_read_varlen(bc);
        else
            count = tmp_mul - tmp_size;
        if (tmp_fields > 6)
            get_s(bc);
        if (tmp_fields > 7)
            tmp_head_idx = ffio_read_varlen(bc);
        while (tmp_fields-- > 8)
            ffio_read_varlen(bc);
        if (count == 0 || i + count > 256) {
            av_log(s, AV_LOG_ERROR, "illegal count %d at %d\n", count, i);
            return AVERROR_INVALIDDATA;
        }
        if (tmp_stream >= stream_count) {
            av_log(s, AV_LOG_ERROR, "illegal stream number\n");
            return AVERROR_INVALIDDATA;
        }
        for (j = 0; j < count; j++, i++) {
            if (i == 'N') {
                nut->frame_code[i].flags = FLAG_INVALID;
                j--;
                continue;
            }
            nut->frame_code[i].flags          = tmp_flags;
            nut->frame_code[i].pts_delta      = tmp_pts;
            nut->frame_code[i].stream_id      = tmp_stream;
            nut->frame_code[i].size_mul       = tmp_mul;
            nut->frame_code[i].size_lsb       = tmp_size + j;
            nut->frame_code[i].reserved_count = tmp_res;
            nut->frame_code[i].header_idx     = tmp_head_idx;
        }
    }
    assert(nut->frame_code['N'].flags == FLAG_INVALID);
    if (end > avio_tell(bc) + 4) {
        int rem = 1024;
        GET_V(nut->header_count, tmp < 128U);
        nut->header_count++;
        for (i = 1; i < nut->header_count; i++) {
            uint8_t *hdr;
            GET_V(nut->header_len[i], tmp > 0 && tmp < 256);
            rem -= nut->header_len[i];
            if (rem < 0) {
                av_log(s, AV_LOG_ERROR, "invalid elision header\n");
                return AVERROR_INVALIDDATA;
            }
            hdr = av_malloc(nut->header_len[i]);
            if (!hdr)
                return AVERROR(ENOMEM);
            avio_read(bc, hdr, nut->header_len[i]);
            nut->header[i] = hdr;
        }
        assert(nut->header_len[0] == 0);
    }
    if (nut->version > NUT_STABLE_VERSION) {
        nut->flags = ffio_read_varlen(bc);
    }
    if (skip_reserved(bc, end) || ffio_get_checksum(bc)) {
        av_log(s, AV_LOG_ERROR, "main header checksum mismatch\n");
        return AVERROR_INVALIDDATA;
    }
    nut->stream = av_mallocz(sizeof(StreamContext) * stream_count);
    for (i = 0; i < stream_count; i++)
        avformat_new_stream(s, NULL);
    return 0;
}
['static int decode_main_header(NUTContext *nut)\n{\n    AVFormatContext *s = nut->avf;\n    AVIOContext *bc    = s->pb;\n    uint64_t tmp, end;\n    unsigned int stream_count;\n    int i, j, count;\n    int tmp_stream, tmp_mul, tmp_pts, tmp_size, tmp_res, tmp_head_idx;\n    end  = get_packetheader(nut, bc, 1, MAIN_STARTCODE);\n    end += avio_tell(bc);\n    nut->version = ffio_read_varlen(bc);\n    if (tmp < NUT_MIN_VERSION && tmp > NUT_MAX_VERSION) {\n        av_log(s, AV_LOG_ERROR, "Version %"PRId64" not supported.\\n",\n               tmp);\n        return AVERROR(ENOSYS);\n    }\n    GET_V(stream_count, tmp > 0 && tmp <= NUT_MAX_STREAMS);\n    nut->max_distance = ffio_read_varlen(bc);\n    if (nut->max_distance > 65536) {\n        av_log(s, AV_LOG_DEBUG, "max_distance %d\\n", nut->max_distance);\n        nut->max_distance = 65536;\n    }\n    GET_V(nut->time_base_count, tmp > 0 && tmp < INT_MAX / sizeof(AVRational));\n    nut->time_base = av_malloc(nut->time_base_count * sizeof(AVRational));\n    for (i = 0; i < nut->time_base_count; i++) {\n        GET_V(nut->time_base[i].num, tmp > 0 && tmp < (1ULL << 31));\n        GET_V(nut->time_base[i].den, tmp > 0 && tmp < (1ULL << 31));\n        if (av_gcd(nut->time_base[i].num, nut->time_base[i].den) != 1) {\n            av_log(s, AV_LOG_ERROR, "time base invalid\\n");\n            return AVERROR_INVALIDDATA;\n        }\n    }\n    tmp_pts      = 0;\n    tmp_mul      = 1;\n    tmp_stream   = 0;\n    tmp_head_idx = 0;\n    for (i = 0; i < 256;) {\n        int tmp_flags  = ffio_read_varlen(bc);\n        int tmp_fields = ffio_read_varlen(bc);\n        if (tmp_fields > 0)\n            tmp_pts = get_s(bc);\n        if (tmp_fields > 1)\n            tmp_mul = ffio_read_varlen(bc);\n        if (tmp_fields > 2)\n            tmp_stream = ffio_read_varlen(bc);\n        if (tmp_fields > 3)\n            tmp_size = ffio_read_varlen(bc);\n        else\n            tmp_size = 0;\n        if (tmp_fields > 4)\n            tmp_res = ffio_read_varlen(bc);\n        else\n            tmp_res = 0;\n        if (tmp_fields > 5)\n            count = ffio_read_varlen(bc);\n        else\n            count = tmp_mul - tmp_size;\n        if (tmp_fields > 6)\n            get_s(bc);\n        if (tmp_fields > 7)\n            tmp_head_idx = ffio_read_varlen(bc);\n        while (tmp_fields-- > 8)\n            ffio_read_varlen(bc);\n        if (count == 0 || i + count > 256) {\n            av_log(s, AV_LOG_ERROR, "illegal count %d at %d\\n", count, i);\n            return AVERROR_INVALIDDATA;\n        }\n        if (tmp_stream >= stream_count) {\n            av_log(s, AV_LOG_ERROR, "illegal stream number\\n");\n            return AVERROR_INVALIDDATA;\n        }\n        for (j = 0; j < count; j++, i++) {\n            if (i == \'N\') {\n                nut->frame_code[i].flags = FLAG_INVALID;\n                j--;\n                continue;\n            }\n            nut->frame_code[i].flags          = tmp_flags;\n            nut->frame_code[i].pts_delta      = tmp_pts;\n            nut->frame_code[i].stream_id      = tmp_stream;\n            nut->frame_code[i].size_mul       = tmp_mul;\n            nut->frame_code[i].size_lsb       = tmp_size + j;\n            nut->frame_code[i].reserved_count = tmp_res;\n            nut->frame_code[i].header_idx     = tmp_head_idx;\n        }\n    }\n    assert(nut->frame_code[\'N\'].flags == FLAG_INVALID);\n    if (end > avio_tell(bc) + 4) {\n        int rem = 1024;\n        GET_V(nut->header_count, tmp < 128U);\n        nut->header_count++;\n        for (i = 1; i < nut->header_count; i++) {\n            uint8_t *hdr;\n            GET_V(nut->header_len[i], tmp > 0 && tmp < 256);\n            rem -= nut->header_len[i];\n            if (rem < 0) {\n                av_log(s, AV_LOG_ERROR, "invalid elision header\\n");\n                return AVERROR_INVALIDDATA;\n            }\n            hdr = av_malloc(nut->header_len[i]);\n            if (!hdr)\n                return AVERROR(ENOMEM);\n            avio_read(bc, hdr, nut->header_len[i]);\n            nut->header[i] = hdr;\n        }\n        assert(nut->header_len[0] == 0);\n    }\n    if (nut->version > NUT_STABLE_VERSION) {\n        nut->flags = ffio_read_varlen(bc);\n    }\n    if (skip_reserved(bc, end) || ffio_get_checksum(bc)) {\n        av_log(s, AV_LOG_ERROR, "main header checksum mismatch\\n");\n        return AVERROR_INVALIDDATA;\n    }\n    nut->stream = av_mallocz(sizeof(StreamContext) * stream_count);\n    for (i = 0; i < stream_count; i++)\n        avformat_new_stream(s, NULL);\n    return 0;\n}']