libavcodec/rv34.c:1226: error: Buffer Overrun L2
  Offset: [1, 281479271743489] Size: 108 by call to `rv34_decode_block`.

libavcodec/rv34.c:1191:5: Call
1189.     // Calculate which neighbours are available. Maybe it's worth optimizing too.
1190.     memset(r->avail_cache, 0, sizeof(r->avail_cache));
1191.     fill_rectangle(r->avail_cache + 6, 2, 2, 4, 1, 4);
          ^
1192.     dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width;
1193.     if(s->mb_x && dist)

libavcodec/rectangle.h:42:1: Parameter `val`
  40.  * @param size the size of val (1, 2 or 4), should be a constant
  41.  */
  42. static av_always_inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t val, int size){
      ^
  43.     uint8_t *p= (uint8_t*)vp;
  44.     assert(size==1 || size==2 || size==4);

libavcodec/rectangle.h:79:9: Assignment
  77.         *(uint64_t*)(p + 3*stride)= v;
  78.     }else if(w==16){
  79.         const uint64_t v= val*0x0100000001ULL;
              ^
  80.         *(uint64_t*)(p + 0+0*stride)= v;
  81.         *(uint64_t*)(p + 8+0*stride)= v;

libavcodec/rectangle.h:83:9: Assignment
  81.         *(uint64_t*)(p + 8+0*stride)= v;
  82.         *(uint64_t*)(p + 0+1*stride)= v;
  83.         *(uint64_t*)(p + 8+1*stride)= v;
              ^
  84.         if(h==2) return;
  85.         *(uint64_t*)(p + 0+2*stride)= v;

libavcodec/rv34.c:1226:13: Call
1224.         q_dc = rv34_qscale_tab[ r->luma_dc_quant_p[s->qscale] ];
1225.         q_ac = rv34_qscale_tab[s->qscale];
1226.         if (rv34_decode_block(block16, gb, r->cur_vlcs, 3, 0, q_dc, q_dc, q_ac))
                  ^
1227.             r->rdsp.rv34_inv_transform(block16);
1228.         else

libavcodec/rv34.c:285:1: Parameter `(*rvlc->second_pattern[*].table)[*]`
  283.  */
  284. 
  285. static int rv34_decode_block(int16_t *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc, int q_dc, int q_ac1, int q_ac2)
       ^
  286. {
  287.     int code, pattern, has_ac = 1;

libavcodec/rv34.c:305:16: Call
  303. 
  304.     if(pattern & 4){
  305.         code = get_vlc2(gb, rvlc->second_pattern[sc].table, 9, 2);
                      ^
  306.         decode_subblock(dst + 4*0+2, code, 0, gb, &rvlc->coefficient, q_ac2);
  307.     }

libavcodec/get_bits.h:521:1: Parameter `(*table)[*]`
    519.  *                  = (max_vlc_length + bits - 1) / bits
    520.  */
    521. static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2],
         ^
    522.                                      int bits, int max_depth)
    523. {

libavcodec/get_bits.h:529:5: Assignment
    527.     UPDATE_CACHE(re, s);
    528. 
    529.     GET_VLC(code, re, s, table, bits, max_depth);
             ^
    530. 
    531.     CLOSE_READER(re, s);

libavcodec/get_bits.h:533:5: Assignment
    531.     CLOSE_READER(re, s);
    532. 
    533.     return code;
             ^
    534. }
    535. 

libavcodec/rv34.c:305:9: Assignment
  303. 
  304.     if(pattern & 4){
  305.         code = get_vlc2(gb, rvlc->second_pattern[sc].table, 9, 2);
               ^
  306.         decode_subblock(dst + 4*0+2, code, 0, gb, &rvlc->coefficient, q_ac2);
  307.     }

libavcodec/rv34.c:306:9: Call
  304.     if(pattern & 4){
  305.         code = get_vlc2(gb, rvlc->second_pattern[sc].table, 9, 2);
  306.         decode_subblock(dst + 4*0+2, code, 0, gb, &rvlc->coefficient, q_ac2);
               ^
  307.     }
  308.     if(pattern & 2){ // Looks like coefficients 1 and 2 are swapped for this block

libavcodec/rv34.c:239:1: <Offset trace>
237.  * Decode 2x2 subblock of coefficients.
238.  */
239. static inline void decode_subblock(int16_t *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q)
     ^
240. {
241.     int flags = modulo_three_table[code];

libavcodec/rv34.c:239:1: Parameter `code`
    237.  * Decode 2x2 subblock of coefficients.
    238.  */
    239. static inline void decode_subblock(int16_t *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q)
         ^
    240. {
    241.     int flags = modulo_three_table[code];

libavcodec/rv34data.h:53:1: <Length trace>
51.  * This table allows conversion from a value back to a vector.
52.  */
53. static const uint8_t modulo_three_table[108] = {
    ^
54.     0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x08, 0x09, 0x0A,
55.     0x10, 0x11, 0x12, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1A,

libavcodec/rv34data.h:53:1: Array declaration
    51.  * This table allows conversion from a value back to a vector.
    52.  */
    53. static const uint8_t modulo_three_table[108] = {
        ^
    54.     0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0x08, 0x09, 0x0A,
    55.     0x10, 0x11, 0x12, 0x14, 0x15, 0x16, 0x18, 0x19, 0x1A,

libavcodec/rv34.c:241:17: Array access: Offset: [1, 281479271743489] Size: 108 by call to `rv34_decode_block` 
    239. static inline void decode_subblock(int16_t *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q)
    240. {
    241.     int flags = modulo_three_table[code];
                         ^
    242. 
    243.     decode_coeff(    dst+0*4+0, (flags >> 6)    , 3, gb, vlc, q);

static inline void decode_subblock(int16_t *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q)
{
    int flags = modulo_three_table[code];
    decode_coeff(    dst+0*4+0, (flags >> 6)    , 3, gb, vlc, q);
    if(is_block2){
        decode_coeff(dst+1*4+0, (flags >> 4) & 3, 2, gb, vlc, q);
        decode_coeff(dst+0*4+1, (flags >> 2) & 3, 2, gb, vlc, q);
    }else{
        decode_coeff(dst+0*4+1, (flags >> 4) & 3, 2, gb, vlc, q);
        decode_coeff(dst+1*4+0, (flags >> 2) & 3, 2, gb, vlc, q);
    }
    decode_coeff(    dst+1*4+1, (flags >> 0) & 3, 2, gb, vlc, q);
}
['static int rv34_decode_inter_macroblock(RV34DecContext *r, int8_t *intra_types)\n{\n    MpegEncContext *s   = &r->s;\n    GetBitContext  *gb  = &s->gb;\n    uint8_t        *dst = s->dest[0];\n    int16_t        *ptr = s->block[0];\n    int          mb_pos = s->mb_x + s->mb_y * s->mb_stride;\n    int cbp, cbp2;\n    int q_dc, q_ac, has_ac;\n    int i, j;\n    int dist;\n    memset(r->avail_cache, 0, sizeof(r->avail_cache));\n    fill_rectangle(r->avail_cache + 6, 2, 2, 4, 1, 4);\n    dist = (s->mb_x - s->resync_mb_x) + (s->mb_y - s->resync_mb_y) * s->mb_width;\n    if(s->mb_x && dist)\n        r->avail_cache[5] =\n        r->avail_cache[9] = s->current_picture_ptr->f.mb_type[mb_pos - 1];\n    if(dist >= s->mb_width)\n        r->avail_cache[2] =\n        r->avail_cache[3] = s->current_picture_ptr->f.mb_type[mb_pos - s->mb_stride];\n    if(((s->mb_x+1) < s->mb_width) && dist >= s->mb_width - 1)\n        r->avail_cache[4] = s->current_picture_ptr->f.mb_type[mb_pos - s->mb_stride + 1];\n    if(s->mb_x && dist > s->mb_width)\n        r->avail_cache[1] = s->current_picture_ptr->f.mb_type[mb_pos - s->mb_stride - 1];\n    s->qscale = r->si.quant;\n    cbp = cbp2 = rv34_decode_inter_mb_header(r, intra_types);\n    r->cbp_luma  [mb_pos] = cbp;\n    r->cbp_chroma[mb_pos] = cbp >> 16;\n    r->deblock_coefs[mb_pos] = rv34_set_deblock_coef(r) | r->cbp_luma[mb_pos];\n    s->current_picture_ptr->f.qscale_table[mb_pos] = s->qscale;\n    if(cbp == -1)\n        return -1;\n    if (IS_INTRA(s->current_picture_ptr->f.mb_type[mb_pos])){\n        if(r->is16) rv34_output_i16x16(r, intra_types, cbp);\n        else        rv34_output_intra(r, intra_types, cbp);\n        return 0;\n    }\n    if(r->is16){\n        LOCAL_ALIGNED_16(int16_t, block16, [16]);\n        memset(block16, 0, 16 * sizeof(*block16));\n        q_dc = rv34_qscale_tab[ r->luma_dc_quant_p[s->qscale] ];\n        q_ac = rv34_qscale_tab[s->qscale];\n        if (rv34_decode_block(block16, gb, r->cur_vlcs, 3, 0, q_dc, q_dc, q_ac))\n            r->rdsp.rv34_inv_transform(block16);\n        else\n            r->rdsp.rv34_inv_transform_dc(block16);\n        q_ac = rv34_qscale_tab[s->qscale];\n        for(j = 0; j < 4; j++){\n            for(i = 0; i < 4; i++, cbp >>= 1){\n                int      dc   = block16[i + j*4];\n                if(cbp & 1){\n                    has_ac = rv34_decode_block(ptr, gb, r->cur_vlcs, r->luma_vlc, 0, q_ac, q_ac, q_ac);\n                }else\n                    has_ac = 0;\n                if(has_ac){\n                    ptr[0] = dc;\n                    r->rdsp.rv34_idct_add(dst+4*i, s->linesize, ptr);\n                }else\n                    r->rdsp.rv34_idct_dc_add(dst+4*i, s->linesize, dc);\n            }\n            dst += 4*s->linesize;\n        }\n        r->cur_vlcs = choose_vlc_set(r->si.quant, r->si.vlc_set, 1);\n    }else{\n        q_ac = rv34_qscale_tab[s->qscale];\n        for(j = 0; j < 4; j++){\n            for(i = 0; i < 4; i++, cbp >>= 1){\n                if(!(cbp & 1)) continue;\n                rv34_process_block(r, dst + 4*i, s->linesize,\n                                   r->luma_vlc, 0, q_ac, q_ac);\n            }\n            dst += 4*s->linesize;\n        }\n    }\n    q_dc = rv34_qscale_tab[rv34_chroma_quant[1][s->qscale]];\n    q_ac = rv34_qscale_tab[rv34_chroma_quant[0][s->qscale]];\n    for(j = 1; j < 3; j++){\n        dst = s->dest[j];\n        for(i = 0; i < 4; i++, cbp >>= 1){\n            uint8_t *pdst;\n            if(!(cbp & 1)) continue;\n            pdst = dst + (i&1)*4 + (i&2)*2*s->uvlinesize;\n            rv34_process_block(r, pdst, s->uvlinesize,\n                               r->chroma_vlc, 1, q_dc, q_ac);\n        }\n    }\n    return 0;\n}', 'static av_always_inline void fill_rectangle(void *vp, int w, int h, int stride, uint32_t val, int size){\n    uint8_t *p= (uint8_t*)vp;\n    assert(size==1 || size==2 || size==4);\n    assert(w<=4);\n    w      *= size;\n    stride *= size;\n    assert((((long)vp)&(FFMIN(w, STRIDE_ALIGN)-1)) == 0);\n    assert((stride&(w-1))==0);\n    if(w==2){\n        const uint16_t v= size==4 ? val : val*0x0101;\n        *(uint16_t*)(p + 0*stride)= v;\n        if(h==1) return;\n        *(uint16_t*)(p + 1*stride)= v;\n        if(h==2) return;\n        *(uint16_t*)(p + 2*stride)= v;\n        *(uint16_t*)(p + 3*stride)= v;\n    }else if(w==4){\n        const uint32_t v= size==4 ? val : size==2 ? val*0x00010001 : val*0x01010101;\n        *(uint32_t*)(p + 0*stride)= v;\n        if(h==1) return;\n        *(uint32_t*)(p + 1*stride)= v;\n        if(h==2) return;\n        *(uint32_t*)(p + 2*stride)= v;\n        *(uint32_t*)(p + 3*stride)= v;\n    }else if(w==8){\n#if HAVE_FAST_64BIT\n        const uint64_t v=  size==2 ? val*0x0001000100010001ULL : val*0x0100000001ULL;\n        *(uint64_t*)(p + 0*stride)= v;\n        if(h==1) return;\n        *(uint64_t*)(p + 1*stride)= v;\n        if(h==2) return;\n        *(uint64_t*)(p + 2*stride)= v;\n        *(uint64_t*)(p + 3*stride)= v;\n    }else if(w==16){\n        const uint64_t v= val*0x0100000001ULL;\n        *(uint64_t*)(p + 0+0*stride)= v;\n        *(uint64_t*)(p + 8+0*stride)= v;\n        *(uint64_t*)(p + 0+1*stride)= v;\n        *(uint64_t*)(p + 8+1*stride)= v;\n        if(h==2) return;\n        *(uint64_t*)(p + 0+2*stride)= v;\n        *(uint64_t*)(p + 8+2*stride)= v;\n        *(uint64_t*)(p + 0+3*stride)= v;\n        *(uint64_t*)(p + 8+3*stride)= v;\n#else\n        const uint32_t v= size==2 ? val*0x00010001 : val;\n        *(uint32_t*)(p + 0+0*stride)= v;\n        *(uint32_t*)(p + 4+0*stride)= v;\n        if(h==1) return;\n        *(uint32_t*)(p + 0+1*stride)= v;\n        *(uint32_t*)(p + 4+1*stride)= v;\n        if(h==2) return;\n        *(uint32_t*)(p + 0+2*stride)= v;\n        *(uint32_t*)(p + 4+2*stride)= v;\n        *(uint32_t*)(p + 0+3*stride)= v;\n        *(uint32_t*)(p + 4+3*stride)= v;\n    }else if(w==16){\n        *(uint32_t*)(p + 0+0*stride)= val;\n        *(uint32_t*)(p + 4+0*stride)= val;\n        *(uint32_t*)(p + 8+0*stride)= val;\n        *(uint32_t*)(p +12+0*stride)= val;\n        *(uint32_t*)(p + 0+1*stride)= val;\n        *(uint32_t*)(p + 4+1*stride)= val;\n        *(uint32_t*)(p + 8+1*stride)= val;\n        *(uint32_t*)(p +12+1*stride)= val;\n        if(h==2) return;\n        *(uint32_t*)(p + 0+2*stride)= val;\n        *(uint32_t*)(p + 4+2*stride)= val;\n        *(uint32_t*)(p + 8+2*stride)= val;\n        *(uint32_t*)(p +12+2*stride)= val;\n        *(uint32_t*)(p + 0+3*stride)= val;\n        *(uint32_t*)(p + 4+3*stride)= val;\n        *(uint32_t*)(p + 8+3*stride)= val;\n        *(uint32_t*)(p +12+3*stride)= val;\n#endif\n    }else\n        assert(0);\n    assert(h==4);\n}', 'static int rv34_decode_block(int16_t *dst, GetBitContext *gb, RV34VLC *rvlc, int fc, int sc, int q_dc, int q_ac1, int q_ac2)\n{\n    int code, pattern, has_ac = 1;\n    code = get_vlc2(gb, rvlc->first_pattern[fc].table, 9, 2);\n    pattern = code & 0x7;\n    code >>= 3;\n    if (modulo_three_table[code] & 0x3F) {\n        decode_subblock3(dst, code, gb, &rvlc->coefficient, q_dc, q_ac1, q_ac2);\n    } else {\n        decode_subblock1(dst, code, gb, &rvlc->coefficient, q_dc);\n        if (!pattern)\n            return 0;\n        has_ac = 0;\n    }\n    if(pattern & 4){\n        code = get_vlc2(gb, rvlc->second_pattern[sc].table, 9, 2);\n        decode_subblock(dst + 4*0+2, code, 0, gb, &rvlc->coefficient, q_ac2);\n    }\n    if(pattern & 2){\n        code = get_vlc2(gb, rvlc->second_pattern[sc].table, 9, 2);\n        decode_subblock(dst + 4*2+0, code, 1, gb, &rvlc->coefficient, q_ac2);\n    }\n    if(pattern & 1){\n        code = get_vlc2(gb, rvlc->third_pattern[sc].table, 9, 2);\n        decode_subblock(dst + 4*2+2, code, 0, gb, &rvlc->coefficient, q_ac2);\n    }\n    return has_ac | pattern;\n}', 'static av_always_inline int get_vlc2(GetBitContext *s, VLC_TYPE (*table)[2],\n                                     int bits, int max_depth)\n{\n    int code;\n    OPEN_READER(re, s);\n    UPDATE_CACHE(re, s);\n    GET_VLC(code, re, s, table, bits, max_depth);\n    CLOSE_READER(re, s);\n    return code;\n}', 'static inline void decode_subblock(int16_t *dst, int code, const int is_block2, GetBitContext *gb, VLC *vlc, int q)\n{\n    int flags = modulo_three_table[code];\n    decode_coeff(    dst+0*4+0, (flags >> 6)    , 3, gb, vlc, q);\n    if(is_block2){\n        decode_coeff(dst+1*4+0, (flags >> 4) & 3, 2, gb, vlc, q);\n        decode_coeff(dst+0*4+1, (flags >> 2) & 3, 2, gb, vlc, q);\n    }else{\n        decode_coeff(dst+0*4+1, (flags >> 4) & 3, 2, gb, vlc, q);\n        decode_coeff(dst+1*4+0, (flags >> 2) & 3, 2, gb, vlc, q);\n    }\n    decode_coeff(    dst+1*4+1, (flags >> 0) & 3, 2, gb, vlc, q);\n}']