libavcodec/dv.c:433: error: Buffer Overrun L2
  Offset: [0, 63] Size: [16, 22] by call to `dv_decode_ac`.

libavcodec/dv.c:385:5: Unknown value from: __infer_skip
383. 
384.     assert((((int)mb_bit_buffer)&7)==0);
385.     assert((((int)vs_bit_buffer)&7)==0);
         ^
386. 
387.     memset(sblock, 0, sizeof(sblock));

libavcodec/dv.c:433:13: Call
431.             printf("MB block: %d, %d ", mb_index, j);
432. #endif
433.             dv_decode_ac(&gb, mb, block);
                 ^
434. 
435.             /* write the remaining bits  in a new buffer only if the

libavcodec/dv.c:290:1: <Offset trace>
288. 
289. /* decode ac coefficients */
290. static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)
     ^
291. {
292.     int last_index = gb->size_in_bits;

libavcodec/dv.c:290:1: Parameter `mb->pos`
  288. 
  289. /* decode ac coefficients */
  290. static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)
       ^
  291. {
  292.     int last_index = gb->size_in_bits;

libavcodec/dv.c:295:5: Assignment
  293.     const uint8_t *scan_table = mb->scan_table;
  294.     const uint32_t *factor_table = mb->factor_table;
  295.     int pos = mb->pos;
           ^
  296.     int partial_bit_count = mb->partial_bit_count;
  297.     int level, run, vlc_len, index;

libavcodec/dv.c:338:9: Assignment
  336.         printf("run=%d level=%d\n", run, level);
  337. #endif
  338.         pos += run;
               ^
  339.         if (pos >= 64)
  340.             break;

libavcodec/dv.c:290:1: <Length trace>
288. 
289. /* decode ac coefficients */
290. static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)
     ^
291. {
292.     int last_index = gb->size_in_bits;

libavcodec/dv.c:290:1: Parameter `*mb->factor_table`
  288. 
  289. /* decode ac coefficients */
  290. static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)
       ^
  291. {
  292.     int last_index = gb->size_in_bits;

libavcodec/dv.c:294:5: Assignment
  292.     int last_index = gb->size_in_bits;
  293.     const uint8_t *scan_table = mb->scan_table;
  294.     const uint32_t *factor_table = mb->factor_table;
           ^
  295.     int pos = mb->pos;
  296.     int partial_bit_count = mb->partial_bit_count;

libavcodec/dv.c:342:24: Array access: Offset: [0, 63] Size: [16, 22] by call to `dv_decode_ac` 
  340.             break;
  341. 
  342.         level = (level*factor_table[pos] + (1 << (dv_iweight_bits-1))) >> dv_iweight_bits;
                              ^
  343.         block[scan_table[pos]] = level;
  344. 

static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)
{
    int last_index = gb->size_in_bits;
    const uint8_t *scan_table = mb->scan_table;
    const uint32_t *factor_table = mb->factor_table;
    int pos = mb->pos;
    int partial_bit_count = mb->partial_bit_count;
    int level, run, vlc_len, index;
    OPEN_READER(re, gb);
    UPDATE_CACHE(re, gb);
    if (partial_bit_count > 0) {
        re_cache = ((unsigned)re_cache >> partial_bit_count) |
                   (mb->partial_bit_buffer << (sizeof(re_cache)*8 - partial_bit_count));
        re_index -= partial_bit_count;
        mb->partial_bit_count = 0;
    }
    for(;;) {
#ifdef VLC_DEBUG
        printf("%2d: bits=%04x index=%d\n", pos, SHOW_UBITS(re, gb, 16), re_index);
#endif
        index = NEG_USR32(re_cache, TEX_VLC_BITS);
        vlc_len = dv_rl_vlc[index].len;
        if (vlc_len < 0) {
            index = NEG_USR32((unsigned)re_cache << TEX_VLC_BITS, -vlc_len) + dv_rl_vlc[index].level;
            vlc_len = TEX_VLC_BITS - vlc_len;
        }
        level = dv_rl_vlc[index].level;
        run = dv_rl_vlc[index].run;
        if (re_index + vlc_len > last_index) {
            mb->partial_bit_count = last_index - re_index;
            mb->partial_bit_buffer = NEG_USR32(re_cache, mb->partial_bit_count);
            re_index = last_index;
            break;
        }
        re_index += vlc_len;
#ifdef VLC_DEBUG
        printf("run=%d level=%d\n", run, level);
#endif
        pos += run;
        if (pos >= 64)
            break;
        level = (level*factor_table[pos] + (1 << (dv_iweight_bits-1))) >> dv_iweight_bits;
        block[scan_table[pos]] = level;
        UPDATE_CACHE(re, gb);
    }
    CLOSE_READER(re, gb);
    mb->pos = pos;
}
['static inline void dv_decode_video_segment(DVVideoContext *s,\n                                           const uint8_t *buf_ptr1,\n                                           const uint16_t *mb_pos_ptr)\n{\n    int quant, dc, dct_mode, class1, j;\n    int mb_index, mb_x, mb_y, v, last_index;\n    int y_stride, linesize;\n    DCTELEM *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    DECLARE_ALIGNED_16(DCTELEM, sblock[5*DV_MAX_BPM][64]);\n    DECLARE_ALIGNED_8(uint8_t, mb_bit_buffer[80 + 4]);\n    DECLARE_ALIGNED_8(uint8_t, vs_bit_buffer[5 * 80 + 4]);\n    const int log2_blocksize= 3-s->avctx->lowres;\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, sizeof(sblock));\n    buf_ptr = buf_ptr1;\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->dv100_idct_factor[((s->sys->height == 720)<<1)|(j >= 4)][class1][quant];\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->dv_idct_factor[class1 == 3][dct_mode]\n                    [quant + dv_quant_offset[class1]];\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#ifdef VLC_DEBUG\n            printf("MB block: %d, %d ", mb_index, j);\n#endif\n            dv_decode_ac(&gb, mb, block);\n            if (mb->pos >= 64)\n                bit_copy(&pb, &gb);\n            block += 64;\n            mb++;\n        }\n#ifdef VLC_DEBUG\n        printf("***pass 2 size=%d MB#=%d\\n", put_bits_count(&pb), mb_index);\n#endif\n        block = block1;\n        mb = mb1;\n        init_get_bits(&gb, mb_bit_buffer, put_bits_count(&pb));\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#ifdef VLC_DEBUG\n    printf("***pass 3 size=%d\\n", put_bits_count(&vs_pb));\n#endif\n    block = &sblock[0][0];\n    mb = mb_data;\n    init_get_bits(&gb, vs_bit_buffer, put_bits_count(&vs_pb));\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#ifdef VLC_DEBUG\n                printf("start %d:%d\\n", mb_index, j);\n#endif\n                dv_decode_ac(&gb, mb, block);\n            }\n            if (mb->pos >= 64 && mb->pos < 127)\n                av_log(NULL, 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        v = *mb_pos_ptr++;\n        mb_x = v & 0xff;\n        mb_y = v >> 8;\n        if (s->sys->height == 720 && !(s->buf[1]&0x0C)) {\n               mb_y -= (mb_y>17)?18:-72;\n        }\n        if ((s->sys->pix_fmt == PIX_FMT_YUV420P) ||\n            (s->sys->pix_fmt == PIX_FMT_YUV411P && mb_x >= (704 / 8)) ||\n            (s->sys->height >= 720 && mb_y != 134)) {\n            y_stride = (s->picture.linesize[0]<<((!is_field_mode[mb_index])*log2_blocksize));\n        } else {\n            y_stride = (2<<log2_blocksize);\n        }\n        y_ptr = s->picture.data[0] + ((mb_y * s->picture.linesize[0] + mb_x)<<log2_blocksize);\n        linesize = s->picture.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 == PIX_FMT_YUV420P)) * s->picture.linesize[1] +\n                     (mb_x>>((s->sys->pix_fmt == PIX_FMT_YUV411P)?2:1)))<<log2_blocksize);\n        for(j=2; j; j--) {\n            uint8_t *c_ptr = s->picture.data[j] + c_offset;\n            if (s->sys->pix_fmt == 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->picture.linesize[j], pixels += 8) {\n                      ptr1= pixels + (1<<(log2_blocksize-1));\n                      c_ptr1 = c_ptr + (s->picture.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->picture.linesize[j]<<((!is_field_mode[mb_index])*log2_blocksize);\n                  linesize = s->picture.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}', 'static void dv_decode_ac(GetBitContext *gb, BlockInfo *mb, DCTELEM *block)\n{\n    int last_index = gb->size_in_bits;\n    const uint8_t *scan_table = mb->scan_table;\n    const uint32_t *factor_table = mb->factor_table;\n    int pos = mb->pos;\n    int partial_bit_count = mb->partial_bit_count;\n    int level, run, vlc_len, index;\n    OPEN_READER(re, gb);\n    UPDATE_CACHE(re, gb);\n    if (partial_bit_count > 0) {\n        re_cache = ((unsigned)re_cache >> partial_bit_count) |\n                   (mb->partial_bit_buffer << (sizeof(re_cache)*8 - partial_bit_count));\n        re_index -= partial_bit_count;\n        mb->partial_bit_count = 0;\n    }\n    for(;;) {\n#ifdef VLC_DEBUG\n        printf("%2d: bits=%04x index=%d\\n", pos, SHOW_UBITS(re, gb, 16), re_index);\n#endif\n        index = NEG_USR32(re_cache, TEX_VLC_BITS);\n        vlc_len = dv_rl_vlc[index].len;\n        if (vlc_len < 0) {\n            index = NEG_USR32((unsigned)re_cache << TEX_VLC_BITS, -vlc_len) + dv_rl_vlc[index].level;\n            vlc_len = TEX_VLC_BITS - vlc_len;\n        }\n        level = dv_rl_vlc[index].level;\n        run = dv_rl_vlc[index].run;\n        if (re_index + vlc_len > last_index) {\n            mb->partial_bit_count = last_index - re_index;\n            mb->partial_bit_buffer = NEG_USR32(re_cache, mb->partial_bit_count);\n            re_index = last_index;\n            break;\n        }\n        re_index += vlc_len;\n#ifdef VLC_DEBUG\n        printf("run=%d level=%d\\n", run, level);\n#endif\n        pos += run;\n        if (pos >= 64)\n            break;\n        level = (level*factor_table[pos] + (1 << (dv_iweight_bits-1))) >> dv_iweight_bits;\n        block[scan_table[pos]] = level;\n        UPDATE_CACHE(re, gb);\n    }\n    CLOSE_READER(re, gb);\n    mb->pos = pos;\n}']