libavcodec/dvdec.c:301: error: Uninitialized Value
  The value read from is_field_mode[_] was never initialized.

libavcodec/dvdec.c:301:19: 
299.                   y_stride = (mb_y == 134) ? (1 << log2_blocksize) :
300.                                              s->frame->linesize[j] << ((!is_field_mode[mb_index]) * log2_blocksize);
301.                   linesize = s->frame->linesize[j] << is_field_mode[mb_index];
                       ^
302.                   (mb++)->    idct_put(c_ptr           , linesize, block); block += 64;
303.                   if (s->sys->bpm == 8) {

static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)
{
    DVVideoContext *s = avctx->priv_data;
    DVwork_chunk *work_chunk = arg;
    int quant, dc, dct_mode, class1, j;
    int mb_index, mb_x, mb_y, last_index;
    int y_stride, linesize;
    int16_t *block, *block1;
    int c_offset;
    uint8_t *y_ptr;
    const uint8_t *buf_ptr;
    PutBitContext pb, vs_pb;
    GetBitContext gb;
    BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1;
    LOCAL_ALIGNED_16(int16_t, sblock, [5*DV_MAX_BPM], [64]);
    LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [  80 + FF_INPUT_BUFFER_PADDING_SIZE]);
    LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5*80 + FF_INPUT_BUFFER_PADDING_SIZE]);
    const int log2_blocksize = 3;
    int is_field_mode[5];
    assert((((int)mb_bit_buffer) & 7) == 0);
    assert((((int)vs_bit_buffer) & 7) == 0);
    memset(sblock, 0, 5*DV_MAX_BPM*sizeof(*sblock));
    buf_ptr = &s->buf[work_chunk->buf_offset*80];
    block1  = &sblock[0][0];
    mb1     = mb_data;
    init_put_bits(&vs_pb, vs_bit_buffer, 5 * 80);
    for (mb_index = 0; mb_index < 5; mb_index++, mb1 += s->sys->bpm, block1 += s->sys->bpm * 64) {
        quant = buf_ptr[3] & 0x0f;
        buf_ptr += 4;
        init_put_bits(&pb, mb_bit_buffer, 80);
        mb    = mb1;
        block = block1;
        is_field_mode[mb_index] = 0;
        for (j = 0; j < s->sys->bpm; j++) {
            last_index = s->sys->block_sizes[j];
            init_get_bits(&gb, buf_ptr, last_index);
            dc       = get_sbits(&gb, 9);
            dct_mode = get_bits1(&gb);
            class1   = get_bits(&gb, 2);
            if (DV_PROFILE_IS_HD(s->sys)) {
                mb->idct_put     = s->idct_put[0];
                mb->scan_table   = s->dv_zigzag[0];
                mb->factor_table = &s->sys->idct_factor[(j >= 4)*4*16*64 + class1*16*64 + quant*64];
                is_field_mode[mb_index] |= !j && dct_mode;
            } else {
                mb->idct_put     = s->idct_put[dct_mode && log2_blocksize == 3];
                mb->scan_table   = s->dv_zigzag[dct_mode];
                mb->factor_table = &s->sys->idct_factor[(class1 == 3)*2*22*64 + dct_mode*22*64 +
                                                        (quant + ff_dv_quant_offset[class1])*64];
            }
            dc = dc << 2;
            dc += 1024;
            block[0] = dc;
            buf_ptr += last_index >> 3;
            mb->pos               = 0;
            mb->partial_bit_count = 0;
            av_dlog(avctx, "MB block: %d, %d ", mb_index, j);
            dv_decode_ac(&gb, mb, block);
            if (mb->pos >= 64)
                bit_copy(&pb, &gb);
            block += 64;
            mb++;
        }
        av_dlog(avctx, "***pass 2 size=%d MB#=%d\n", put_bits_count(&pb), mb_index);
        block = block1;
        mb    = mb1;
        init_get_bits(&gb, mb_bit_buffer, put_bits_count(&pb));
        put_bits32(&pb, 0);
        flush_put_bits(&pb);
        for (j = 0; j < s->sys->bpm; j++, block += 64, mb++) {
            if (mb->pos < 64 && get_bits_left(&gb) > 0) {
                dv_decode_ac(&gb, mb, block);
                if (mb->pos < 64)
                    break;
            }
        }
        if (j >= s->sys->bpm)
            bit_copy(&vs_pb, &gb);
    }
    av_dlog(avctx, "***pass 3 size=%d\n", put_bits_count(&vs_pb));
    block = &sblock[0][0];
    mb    = mb_data;
    init_get_bits(&gb, vs_bit_buffer, put_bits_count(&vs_pb));
    put_bits32(&vs_pb, 0);
    flush_put_bits(&vs_pb);
    for (mb_index = 0; mb_index < 5; mb_index++) {
        for (j = 0; j < s->sys->bpm; j++) {
            if (mb->pos < 64) {
                av_dlog(avctx, "start %d:%d\n", mb_index, j);
                dv_decode_ac(&gb, mb, block);
            }
            if (mb->pos >= 64 && mb->pos < 127)
                av_log(avctx, AV_LOG_ERROR, "AC EOB marker is absent pos=%d\n", mb->pos);
            block += 64;
            mb++;
        }
    }
    block = &sblock[0][0];
    mb    = mb_data;
    for (mb_index = 0; mb_index < 5; mb_index++) {
        dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y);
        if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) ||
            (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) ||
            (s->sys->height >= 720 && mb_y != 134)) {
            y_stride = (s->frame->linesize[0] << ((!is_field_mode[mb_index]) * log2_blocksize));
        } else {
            y_stride = (2 << log2_blocksize);
        }
        y_ptr = s->frame->data[0] + ((mb_y * s->frame->linesize[0] + mb_x) << log2_blocksize);
        linesize = s->frame->linesize[0] << is_field_mode[mb_index];
        mb[0]    .idct_put(y_ptr                                   , linesize, block + 0*64);
        if (s->sys->video_stype == 4) {
            mb[2].idct_put(y_ptr + (1 << log2_blocksize)           , linesize, block + 2*64);
        } else {
            mb[1].idct_put(y_ptr + (1 << log2_blocksize)           , linesize, block + 1*64);
            mb[2].idct_put(y_ptr                         + y_stride, linesize, block + 2*64);
            mb[3].idct_put(y_ptr + (1 << log2_blocksize) + y_stride, linesize, block + 3*64);
        }
        mb += 4;
        block += 4*64;
        c_offset = (((mb_y >>  (s->sys->pix_fmt == AV_PIX_FMT_YUV420P)) * s->frame->linesize[1] +
                     (mb_x >> ((s->sys->pix_fmt == AV_PIX_FMT_YUV411P) ? 2 : 1))) << log2_blocksize);
        for (j = 2; j; j--) {
            uint8_t *c_ptr = s->frame->data[j] + c_offset;
            if (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) {
                  uint64_t aligned_pixels[64/8];
                  uint8_t *pixels = (uint8_t*)aligned_pixels;
                  uint8_t *c_ptr1, *ptr1;
                  int x, y;
                  mb->idct_put(pixels, 8, block);
                  for (y = 0; y < (1 << log2_blocksize); y++, c_ptr += s->frame->linesize[j], pixels += 8) {
                      ptr1   = pixels + (1 << (log2_blocksize - 1));
                      c_ptr1 = c_ptr + (s->frame->linesize[j] << log2_blocksize);
                      for (x = 0; x < (1 << (log2_blocksize - 1)); x++) {
                          c_ptr[x]  = pixels[x];
                          c_ptr1[x] = ptr1[x];
                      }
                  }
                  block += 64; mb++;
            } else {
                  y_stride = (mb_y == 134) ? (1 << log2_blocksize) :
                                             s->frame->linesize[j] << ((!is_field_mode[mb_index]) * log2_blocksize);
                  linesize = s->frame->linesize[j] << is_field_mode[mb_index];
                  (mb++)->    idct_put(c_ptr           , linesize, block); block += 64;
                  if (s->sys->bpm == 8) {
                      (mb++)->idct_put(c_ptr + y_stride, linesize, block); block += 64;
                  }
            }
        }
    }
    return 0;
}
['static int dv_decode_video_segment(AVCodecContext *avctx, void *arg)\n{\n    DVVideoContext *s = avctx->priv_data;\n    DVwork_chunk *work_chunk = arg;\n    int quant, dc, dct_mode, class1, j;\n    int mb_index, mb_x, mb_y, last_index;\n    int y_stride, linesize;\n    int16_t *block, *block1;\n    int c_offset;\n    uint8_t *y_ptr;\n    const uint8_t *buf_ptr;\n    PutBitContext pb, vs_pb;\n    GetBitContext gb;\n    BlockInfo mb_data[5 * DV_MAX_BPM], *mb, *mb1;\n    LOCAL_ALIGNED_16(int16_t, sblock, [5*DV_MAX_BPM], [64]);\n    LOCAL_ALIGNED_16(uint8_t, mb_bit_buffer, [  80 + FF_INPUT_BUFFER_PADDING_SIZE]);\n    LOCAL_ALIGNED_16(uint8_t, vs_bit_buffer, [5*80 + FF_INPUT_BUFFER_PADDING_SIZE]);\n    const int log2_blocksize = 3;\n    int is_field_mode[5];\n    assert((((int)mb_bit_buffer) & 7) == 0);\n    assert((((int)vs_bit_buffer) & 7) == 0);\n    memset(sblock, 0, 5*DV_MAX_BPM*sizeof(*sblock));\n    buf_ptr = &s->buf[work_chunk->buf_offset*80];\n    block1  = &sblock[0][0];\n    mb1     = mb_data;\n    init_put_bits(&vs_pb, vs_bit_buffer, 5 * 80);\n    for (mb_index = 0; mb_index < 5; mb_index++, mb1 += s->sys->bpm, block1 += s->sys->bpm * 64) {\n        quant = buf_ptr[3] & 0x0f;\n        buf_ptr += 4;\n        init_put_bits(&pb, mb_bit_buffer, 80);\n        mb    = mb1;\n        block = block1;\n        is_field_mode[mb_index] = 0;\n        for (j = 0; j < s->sys->bpm; j++) {\n            last_index = s->sys->block_sizes[j];\n            init_get_bits(&gb, buf_ptr, last_index);\n            dc       = get_sbits(&gb, 9);\n            dct_mode = get_bits1(&gb);\n            class1   = get_bits(&gb, 2);\n            if (DV_PROFILE_IS_HD(s->sys)) {\n                mb->idct_put     = s->idct_put[0];\n                mb->scan_table   = s->dv_zigzag[0];\n                mb->factor_table = &s->sys->idct_factor[(j >= 4)*4*16*64 + class1*16*64 + quant*64];\n                is_field_mode[mb_index] |= !j && dct_mode;\n            } else {\n                mb->idct_put     = s->idct_put[dct_mode && log2_blocksize == 3];\n                mb->scan_table   = s->dv_zigzag[dct_mode];\n                mb->factor_table = &s->sys->idct_factor[(class1 == 3)*2*22*64 + dct_mode*22*64 +\n                                                        (quant + ff_dv_quant_offset[class1])*64];\n            }\n            dc = dc << 2;\n            dc += 1024;\n            block[0] = dc;\n            buf_ptr += last_index >> 3;\n            mb->pos               = 0;\n            mb->partial_bit_count = 0;\n            av_dlog(avctx, "MB block: %d, %d ", mb_index, j);\n            dv_decode_ac(&gb, mb, block);\n            if (mb->pos >= 64)\n                bit_copy(&pb, &gb);\n            block += 64;\n            mb++;\n        }\n        av_dlog(avctx, "***pass 2 size=%d MB#=%d\\n", put_bits_count(&pb), mb_index);\n        block = block1;\n        mb    = mb1;\n        init_get_bits(&gb, mb_bit_buffer, put_bits_count(&pb));\n        put_bits32(&pb, 0);\n        flush_put_bits(&pb);\n        for (j = 0; j < s->sys->bpm; j++, block += 64, mb++) {\n            if (mb->pos < 64 && get_bits_left(&gb) > 0) {\n                dv_decode_ac(&gb, mb, block);\n                if (mb->pos < 64)\n                    break;\n            }\n        }\n        if (j >= s->sys->bpm)\n            bit_copy(&vs_pb, &gb);\n    }\n    av_dlog(avctx, "***pass 3 size=%d\\n", put_bits_count(&vs_pb));\n    block = &sblock[0][0];\n    mb    = mb_data;\n    init_get_bits(&gb, vs_bit_buffer, put_bits_count(&vs_pb));\n    put_bits32(&vs_pb, 0);\n    flush_put_bits(&vs_pb);\n    for (mb_index = 0; mb_index < 5; mb_index++) {\n        for (j = 0; j < s->sys->bpm; j++) {\n            if (mb->pos < 64) {\n                av_dlog(avctx, "start %d:%d\\n", mb_index, j);\n                dv_decode_ac(&gb, mb, block);\n            }\n            if (mb->pos >= 64 && mb->pos < 127)\n                av_log(avctx, AV_LOG_ERROR, "AC EOB marker is absent pos=%d\\n", mb->pos);\n            block += 64;\n            mb++;\n        }\n    }\n    block = &sblock[0][0];\n    mb    = mb_data;\n    for (mb_index = 0; mb_index < 5; mb_index++) {\n        dv_calculate_mb_xy(s, work_chunk, mb_index, &mb_x, &mb_y);\n        if ((s->sys->pix_fmt == AV_PIX_FMT_YUV420P) ||\n            (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) ||\n            (s->sys->height >= 720 && mb_y != 134)) {\n            y_stride = (s->frame->linesize[0] << ((!is_field_mode[mb_index]) * log2_blocksize));\n        } else {\n            y_stride = (2 << log2_blocksize);\n        }\n        y_ptr = s->frame->data[0] + ((mb_y * s->frame->linesize[0] + mb_x) << log2_blocksize);\n        linesize = s->frame->linesize[0] << is_field_mode[mb_index];\n        mb[0]    .idct_put(y_ptr                                   , linesize, block + 0*64);\n        if (s->sys->video_stype == 4) {\n            mb[2].idct_put(y_ptr + (1 << log2_blocksize)           , linesize, block + 2*64);\n        } else {\n            mb[1].idct_put(y_ptr + (1 << log2_blocksize)           , linesize, block + 1*64);\n            mb[2].idct_put(y_ptr                         + y_stride, linesize, block + 2*64);\n            mb[3].idct_put(y_ptr + (1 << log2_blocksize) + y_stride, linesize, block + 3*64);\n        }\n        mb += 4;\n        block += 4*64;\n        c_offset = (((mb_y >>  (s->sys->pix_fmt == AV_PIX_FMT_YUV420P)) * s->frame->linesize[1] +\n                     (mb_x >> ((s->sys->pix_fmt == AV_PIX_FMT_YUV411P) ? 2 : 1))) << log2_blocksize);\n        for (j = 2; j; j--) {\n            uint8_t *c_ptr = s->frame->data[j] + c_offset;\n            if (s->sys->pix_fmt == AV_PIX_FMT_YUV411P && mb_x >= (704 / 8)) {\n                  uint64_t aligned_pixels[64/8];\n                  uint8_t *pixels = (uint8_t*)aligned_pixels;\n                  uint8_t *c_ptr1, *ptr1;\n                  int x, y;\n                  mb->idct_put(pixels, 8, block);\n                  for (y = 0; y < (1 << log2_blocksize); y++, c_ptr += s->frame->linesize[j], pixels += 8) {\n                      ptr1   = pixels + (1 << (log2_blocksize - 1));\n                      c_ptr1 = c_ptr + (s->frame->linesize[j] << log2_blocksize);\n                      for (x = 0; x < (1 << (log2_blocksize - 1)); x++) {\n                          c_ptr[x]  = pixels[x];\n                          c_ptr1[x] = ptr1[x];\n                      }\n                  }\n                  block += 64; mb++;\n            } else {\n                  y_stride = (mb_y == 134) ? (1 << log2_blocksize) :\n                                             s->frame->linesize[j] << ((!is_field_mode[mb_index]) * log2_blocksize);\n                  linesize = s->frame->linesize[j] << is_field_mode[mb_index];\n                  (mb++)->    idct_put(c_ptr           , linesize, block); block += 64;\n                  if (s->sys->bpm == 8) {\n                      (mb++)->idct_put(c_ptr + y_stride, linesize, block); block += 64;\n                  }\n            }\n        }\n    }\n    return 0;\n}']