libavcodec/vc1dec.c:1946: error: Uninitialized Value
  The value read from py was never initialized.

libavcodec/vc1dec.c:1946:22: 
1944.     /* store MV using signed modulus of MV range defined in 4.11 */
1945.     s->mv[0][n][0] = s->current_picture.f.motion_val[0][xy][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x;
1946.     s->mv[0][n][1] = s->current_picture.f.motion_val[0][xy][1] = ((py + dmv_y + r_y) & ((r_y << 1) - 1)) - r_y;
                           ^
1947.     if (mvn == 1) { /* duplicate motion data for 1-MV block */
1948.         s->current_picture.f.motion_val[0][xy +    1    ][0] = s->current_picture.f.motion_val[0][xy][0];

static inline void vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y,
                                     int mvn, int r_x, int r_y, uint8_t* is_intra)
{
    MpegEncContext *s = &v->s;
    int xy, wrap, off = 0;
    int A[2], B[2], C[2];
    int px, py;
    int a_valid = 0, b_valid = 0, c_valid = 0;
    int field_a, field_b, field_c;
    int total_valid, num_samefield, num_oppfield;
    int pos_c, pos_b, n_adj;
    wrap = s->b8_stride;
    xy = s->block_index[n];
    if (s->mb_intra) {
        s->mv[0][n][0] = s->current_picture.f.motion_val[0][xy][0] = 0;
        s->mv[0][n][1] = s->current_picture.f.motion_val[0][xy][1] = 0;
        s->current_picture.f.motion_val[1][xy][0] = 0;
        s->current_picture.f.motion_val[1][xy][1] = 0;
        if (mvn == 1) {
            s->current_picture.f.motion_val[0][xy + 1][0]        = 0;
            s->current_picture.f.motion_val[0][xy + 1][1]        = 0;
            s->current_picture.f.motion_val[0][xy + wrap][0]     = 0;
            s->current_picture.f.motion_val[0][xy + wrap][1]     = 0;
            s->current_picture.f.motion_val[0][xy + wrap + 1][0] = 0;
            s->current_picture.f.motion_val[0][xy + wrap + 1][1] = 0;
            v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0;
            s->current_picture.f.motion_val[1][xy + 1][0]        = 0;
            s->current_picture.f.motion_val[1][xy + 1][1]        = 0;
            s->current_picture.f.motion_val[1][xy + wrap][0]     = 0;
            s->current_picture.f.motion_val[1][xy + wrap][1]     = 0;
            s->current_picture.f.motion_val[1][xy + wrap + 1][0] = 0;
            s->current_picture.f.motion_val[1][xy + wrap + 1][1] = 0;
        }
        return;
    }
    off = ((n == 0) || (n == 1)) ? 1 : -1;
    if (s->mb_x || (n == 1) || (n == 3)) {
        if ((v->blk_mv_type[xy])
            || (!v->blk_mv_type[xy] && !v->blk_mv_type[xy - 1])) {
            A[0] = s->current_picture.f.motion_val[0][xy - 1][0];
            A[1] = s->current_picture.f.motion_val[0][xy - 1][1];
            a_valid = 1;
        } else {
            A[0] = (s->current_picture.f.motion_val[0][xy - 1][0]
                    + s->current_picture.f.motion_val[0][xy - 1 + off * wrap][0] + 1) >> 1;
            A[1] = (s->current_picture.f.motion_val[0][xy - 1][1]
                    + s->current_picture.f.motion_val[0][xy - 1 + off * wrap][1] + 1) >> 1;
            a_valid = 1;
        }
        if (!(n & 1) && v->is_intra[s->mb_x - 1]) {
            a_valid = 0;
            A[0] = A[1] = 0;
        }
    } else
        A[0] = A[1] = 0;
    B[0] = B[1] = C[0] = C[1] = 0;
    if (n == 0 || n == 1 || v->blk_mv_type[xy]) {
        if (!s->first_slice_line) {
            if (!v->is_intra[s->mb_x - s->mb_stride]) {
                b_valid = 1;
                n_adj   = n | 2;
                pos_b   = s->block_index[n_adj] - 2 * wrap;
                if (v->blk_mv_type[pos_b] && v->blk_mv_type[xy]) {
                    n_adj = (n & 2) | (n & 1);
                }
                B[0] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap][0];
                B[1] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap][1];
                if (v->blk_mv_type[pos_b] && !v->blk_mv_type[xy]) {
                    B[0] = (B[0] + s->current_picture.f.motion_val[0][s->block_index[n_adj ^ 2] - 2 * wrap][0] + 1) >> 1;
                    B[1] = (B[1] + s->current_picture.f.motion_val[0][s->block_index[n_adj ^ 2] - 2 * wrap][1] + 1) >> 1;
                }
            }
            if (s->mb_width > 1) {
                if (!v->is_intra[s->mb_x - s->mb_stride + 1]) {
                    c_valid = 1;
                    n_adj   = 2;
                    pos_c   = s->block_index[2] - 2 * wrap + 2;
                    if (v->blk_mv_type[pos_c] && v->blk_mv_type[xy]) {
                        n_adj = n & 2;
                    }
                    C[0] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap + 2][0];
                    C[1] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap + 2][1];
                    if (v->blk_mv_type[pos_c] && !v->blk_mv_type[xy]) {
                        C[0] = (1 + C[0] + (s->current_picture.f.motion_val[0][s->block_index[n_adj ^ 2] - 2 * wrap + 2][0])) >> 1;
                        C[1] = (1 + C[1] + (s->current_picture.f.motion_val[0][s->block_index[n_adj ^ 2] - 2 * wrap + 2][1])) >> 1;
                    }
                    if (s->mb_x == s->mb_width - 1) {
                        if (!v->is_intra[s->mb_x - s->mb_stride - 1]) {
                            c_valid = 1;
                            n_adj   = 3;
                            pos_c   = s->block_index[3] - 2 * wrap - 2;
                            if (v->blk_mv_type[pos_c] && v->blk_mv_type[xy]) {
                                n_adj = n | 1;
                            }
                            C[0] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap - 2][0];
                            C[1] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap - 2][1];
                            if (v->blk_mv_type[pos_c] && !v->blk_mv_type[xy]) {
                                C[0] = (1 + C[0] + s->current_picture.f.motion_val[0][s->block_index[1] - 2 * wrap - 2][0]) >> 1;
                                C[1] = (1 + C[1] + s->current_picture.f.motion_val[0][s->block_index[1] - 2 * wrap - 2][1]) >> 1;
                            }
                        } else
                            c_valid = 0;
                    }
                }
            }
        }
    } else {
        pos_b   = s->block_index[1];
        b_valid = 1;
        B[0]    = s->current_picture.f.motion_val[0][pos_b][0];
        B[1]    = s->current_picture.f.motion_val[0][pos_b][1];
        pos_c   = s->block_index[0];
        c_valid = 1;
        C[0]    = s->current_picture.f.motion_val[0][pos_c][0];
        C[1]    = s->current_picture.f.motion_val[0][pos_c][1];
    }
    total_valid = a_valid + b_valid + c_valid;
    if (!s->mb_x && !(n == 1 || n == 3)) {
        A[0] = A[1] = 0;
    }
    if ((s->first_slice_line && v->blk_mv_type[xy]) || (s->first_slice_line && !(n & 2))) {
        B[0] = B[1] = C[0] = C[1] = 0;
    }
    if (!v->blk_mv_type[xy]) {
        if (s->mb_width == 1) {
            px = B[0];
            py = B[1];
        } else {
            if (total_valid >= 2) {
                px = mid_pred(A[0], B[0], C[0]);
                py = mid_pred(A[1], B[1], C[1]);
            } else if (total_valid) {
                if (a_valid) { px = A[0]; py = A[1]; }
                if (b_valid) { px = B[0]; py = B[1]; }
                if (c_valid) { px = C[0]; py = C[1]; }
            } else
                px = py = 0;
        }
    } else {
        if (a_valid)
            field_a = (A[1] & 4) ? 1 : 0;
        else
            field_a = 0;
        if (b_valid)
            field_b = (B[1] & 4) ? 1 : 0;
        else
            field_b = 0;
        if (c_valid)
            field_c = (C[1] & 4) ? 1 : 0;
        else
            field_c = 0;
        num_oppfield  = field_a + field_b + field_c;
        num_samefield = total_valid - num_oppfield;
        if (total_valid == 3) {
            if ((num_samefield == 3) || (num_oppfield == 3)) {
                px = mid_pred(A[0], B[0], C[0]);
                py = mid_pred(A[1], B[1], C[1]);
            } else if (num_samefield >= num_oppfield) {
                px = !field_a ? A[0] : B[0];
                py = !field_a ? A[1] : B[1];
            } else {
                px =  field_a ? A[0] : B[0];
                py =  field_a ? A[1] : B[1];
            }
        } else if (total_valid == 2) {
            if (num_samefield >= num_oppfield) {
                if (!field_a && a_valid) {
                    px = A[0];
                    py = A[1];
                } else if (!field_b && b_valid) {
                    px = B[0];
                    py = B[1];
                } else if (c_valid) {
                    px = C[0];
                    py = C[1];
                } else px = py = 0;
            } else {
                if (field_a && a_valid) {
                    px = A[0];
                    py = A[1];
                } else if (field_b && b_valid) {
                    px = B[0];
                    py = B[1];
                } else if (c_valid) {
                    px = C[0];
                    py = C[1];
                }
            }
        } else if (total_valid == 1) {
            px = (a_valid) ? A[0] : ((b_valid) ? B[0] : C[0]);
            py = (a_valid) ? A[1] : ((b_valid) ? B[1] : C[1]);
        } else
            px = py = 0;
    }
    s->mv[0][n][0] = s->current_picture.f.motion_val[0][xy][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x;
    s->mv[0][n][1] = s->current_picture.f.motion_val[0][xy][1] = ((py + dmv_y + r_y) & ((r_y << 1) - 1)) - r_y;
    if (mvn == 1) {
        s->current_picture.f.motion_val[0][xy +    1    ][0] = s->current_picture.f.motion_val[0][xy][0];
        s->current_picture.f.motion_val[0][xy +    1    ][1] = s->current_picture.f.motion_val[0][xy][1];
        s->current_picture.f.motion_val[0][xy + wrap    ][0] = s->current_picture.f.motion_val[0][xy][0];
        s->current_picture.f.motion_val[0][xy + wrap    ][1] = s->current_picture.f.motion_val[0][xy][1];
        s->current_picture.f.motion_val[0][xy + wrap + 1][0] = s->current_picture.f.motion_val[0][xy][0];
        s->current_picture.f.motion_val[0][xy + wrap + 1][1] = s->current_picture.f.motion_val[0][xy][1];
    } else if (mvn == 2) {
        s->current_picture.f.motion_val[0][xy + 1][0] = s->current_picture.f.motion_val[0][xy][0];
        s->current_picture.f.motion_val[0][xy + 1][1] = s->current_picture.f.motion_val[0][xy][1];
        s->mv[0][n + 1][0] = s->mv[0][n][0];
        s->mv[0][n + 1][1] = s->mv[0][n][1];
    }
}
['static inline void vc1_pred_mv_intfr(VC1Context *v, int n, int dmv_x, int dmv_y,\n                                     int mvn, int r_x, int r_y, uint8_t* is_intra)\n{\n    MpegEncContext *s = &v->s;\n    int xy, wrap, off = 0;\n    int A[2], B[2], C[2];\n    int px, py;\n    int a_valid = 0, b_valid = 0, c_valid = 0;\n    int field_a, field_b, field_c;\n    int total_valid, num_samefield, num_oppfield;\n    int pos_c, pos_b, n_adj;\n    wrap = s->b8_stride;\n    xy = s->block_index[n];\n    if (s->mb_intra) {\n        s->mv[0][n][0] = s->current_picture.f.motion_val[0][xy][0] = 0;\n        s->mv[0][n][1] = s->current_picture.f.motion_val[0][xy][1] = 0;\n        s->current_picture.f.motion_val[1][xy][0] = 0;\n        s->current_picture.f.motion_val[1][xy][1] = 0;\n        if (mvn == 1) {\n            s->current_picture.f.motion_val[0][xy + 1][0]        = 0;\n            s->current_picture.f.motion_val[0][xy + 1][1]        = 0;\n            s->current_picture.f.motion_val[0][xy + wrap][0]     = 0;\n            s->current_picture.f.motion_val[0][xy + wrap][1]     = 0;\n            s->current_picture.f.motion_val[0][xy + wrap + 1][0] = 0;\n            s->current_picture.f.motion_val[0][xy + wrap + 1][1] = 0;\n            v->luma_mv[s->mb_x][0] = v->luma_mv[s->mb_x][1] = 0;\n            s->current_picture.f.motion_val[1][xy + 1][0]        = 0;\n            s->current_picture.f.motion_val[1][xy + 1][1]        = 0;\n            s->current_picture.f.motion_val[1][xy + wrap][0]     = 0;\n            s->current_picture.f.motion_val[1][xy + wrap][1]     = 0;\n            s->current_picture.f.motion_val[1][xy + wrap + 1][0] = 0;\n            s->current_picture.f.motion_val[1][xy + wrap + 1][1] = 0;\n        }\n        return;\n    }\n    off = ((n == 0) || (n == 1)) ? 1 : -1;\n    if (s->mb_x || (n == 1) || (n == 3)) {\n        if ((v->blk_mv_type[xy])\n            || (!v->blk_mv_type[xy] && !v->blk_mv_type[xy - 1])) {\n            A[0] = s->current_picture.f.motion_val[0][xy - 1][0];\n            A[1] = s->current_picture.f.motion_val[0][xy - 1][1];\n            a_valid = 1;\n        } else {\n            A[0] = (s->current_picture.f.motion_val[0][xy - 1][0]\n                    + s->current_picture.f.motion_val[0][xy - 1 + off * wrap][0] + 1) >> 1;\n            A[1] = (s->current_picture.f.motion_val[0][xy - 1][1]\n                    + s->current_picture.f.motion_val[0][xy - 1 + off * wrap][1] + 1) >> 1;\n            a_valid = 1;\n        }\n        if (!(n & 1) && v->is_intra[s->mb_x - 1]) {\n            a_valid = 0;\n            A[0] = A[1] = 0;\n        }\n    } else\n        A[0] = A[1] = 0;\n    B[0] = B[1] = C[0] = C[1] = 0;\n    if (n == 0 || n == 1 || v->blk_mv_type[xy]) {\n        if (!s->first_slice_line) {\n            if (!v->is_intra[s->mb_x - s->mb_stride]) {\n                b_valid = 1;\n                n_adj   = n | 2;\n                pos_b   = s->block_index[n_adj] - 2 * wrap;\n                if (v->blk_mv_type[pos_b] && v->blk_mv_type[xy]) {\n                    n_adj = (n & 2) | (n & 1);\n                }\n                B[0] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap][0];\n                B[1] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap][1];\n                if (v->blk_mv_type[pos_b] && !v->blk_mv_type[xy]) {\n                    B[0] = (B[0] + s->current_picture.f.motion_val[0][s->block_index[n_adj ^ 2] - 2 * wrap][0] + 1) >> 1;\n                    B[1] = (B[1] + s->current_picture.f.motion_val[0][s->block_index[n_adj ^ 2] - 2 * wrap][1] + 1) >> 1;\n                }\n            }\n            if (s->mb_width > 1) {\n                if (!v->is_intra[s->mb_x - s->mb_stride + 1]) {\n                    c_valid = 1;\n                    n_adj   = 2;\n                    pos_c   = s->block_index[2] - 2 * wrap + 2;\n                    if (v->blk_mv_type[pos_c] && v->blk_mv_type[xy]) {\n                        n_adj = n & 2;\n                    }\n                    C[0] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap + 2][0];\n                    C[1] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap + 2][1];\n                    if (v->blk_mv_type[pos_c] && !v->blk_mv_type[xy]) {\n                        C[0] = (1 + C[0] + (s->current_picture.f.motion_val[0][s->block_index[n_adj ^ 2] - 2 * wrap + 2][0])) >> 1;\n                        C[1] = (1 + C[1] + (s->current_picture.f.motion_val[0][s->block_index[n_adj ^ 2] - 2 * wrap + 2][1])) >> 1;\n                    }\n                    if (s->mb_x == s->mb_width - 1) {\n                        if (!v->is_intra[s->mb_x - s->mb_stride - 1]) {\n                            c_valid = 1;\n                            n_adj   = 3;\n                            pos_c   = s->block_index[3] - 2 * wrap - 2;\n                            if (v->blk_mv_type[pos_c] && v->blk_mv_type[xy]) {\n                                n_adj = n | 1;\n                            }\n                            C[0] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap - 2][0];\n                            C[1] = s->current_picture.f.motion_val[0][s->block_index[n_adj] - 2 * wrap - 2][1];\n                            if (v->blk_mv_type[pos_c] && !v->blk_mv_type[xy]) {\n                                C[0] = (1 + C[0] + s->current_picture.f.motion_val[0][s->block_index[1] - 2 * wrap - 2][0]) >> 1;\n                                C[1] = (1 + C[1] + s->current_picture.f.motion_val[0][s->block_index[1] - 2 * wrap - 2][1]) >> 1;\n                            }\n                        } else\n                            c_valid = 0;\n                    }\n                }\n            }\n        }\n    } else {\n        pos_b   = s->block_index[1];\n        b_valid = 1;\n        B[0]    = s->current_picture.f.motion_val[0][pos_b][0];\n        B[1]    = s->current_picture.f.motion_val[0][pos_b][1];\n        pos_c   = s->block_index[0];\n        c_valid = 1;\n        C[0]    = s->current_picture.f.motion_val[0][pos_c][0];\n        C[1]    = s->current_picture.f.motion_val[0][pos_c][1];\n    }\n    total_valid = a_valid + b_valid + c_valid;\n    if (!s->mb_x && !(n == 1 || n == 3)) {\n        A[0] = A[1] = 0;\n    }\n    if ((s->first_slice_line && v->blk_mv_type[xy]) || (s->first_slice_line && !(n & 2))) {\n        B[0] = B[1] = C[0] = C[1] = 0;\n    }\n    if (!v->blk_mv_type[xy]) {\n        if (s->mb_width == 1) {\n            px = B[0];\n            py = B[1];\n        } else {\n            if (total_valid >= 2) {\n                px = mid_pred(A[0], B[0], C[0]);\n                py = mid_pred(A[1], B[1], C[1]);\n            } else if (total_valid) {\n                if (a_valid) { px = A[0]; py = A[1]; }\n                if (b_valid) { px = B[0]; py = B[1]; }\n                if (c_valid) { px = C[0]; py = C[1]; }\n            } else\n                px = py = 0;\n        }\n    } else {\n        if (a_valid)\n            field_a = (A[1] & 4) ? 1 : 0;\n        else\n            field_a = 0;\n        if (b_valid)\n            field_b = (B[1] & 4) ? 1 : 0;\n        else\n            field_b = 0;\n        if (c_valid)\n            field_c = (C[1] & 4) ? 1 : 0;\n        else\n            field_c = 0;\n        num_oppfield  = field_a + field_b + field_c;\n        num_samefield = total_valid - num_oppfield;\n        if (total_valid == 3) {\n            if ((num_samefield == 3) || (num_oppfield == 3)) {\n                px = mid_pred(A[0], B[0], C[0]);\n                py = mid_pred(A[1], B[1], C[1]);\n            } else if (num_samefield >= num_oppfield) {\n                px = !field_a ? A[0] : B[0];\n                py = !field_a ? A[1] : B[1];\n            } else {\n                px =  field_a ? A[0] : B[0];\n                py =  field_a ? A[1] : B[1];\n            }\n        } else if (total_valid == 2) {\n            if (num_samefield >= num_oppfield) {\n                if (!field_a && a_valid) {\n                    px = A[0];\n                    py = A[1];\n                } else if (!field_b && b_valid) {\n                    px = B[0];\n                    py = B[1];\n                } else if (c_valid) {\n                    px = C[0];\n                    py = C[1];\n                } else px = py = 0;\n            } else {\n                if (field_a && a_valid) {\n                    px = A[0];\n                    py = A[1];\n                } else if (field_b && b_valid) {\n                    px = B[0];\n                    py = B[1];\n                } else if (c_valid) {\n                    px = C[0];\n                    py = C[1];\n                }\n            }\n        } else if (total_valid == 1) {\n            px = (a_valid) ? A[0] : ((b_valid) ? B[0] : C[0]);\n            py = (a_valid) ? A[1] : ((b_valid) ? B[1] : C[1]);\n        } else\n            px = py = 0;\n    }\n    s->mv[0][n][0] = s->current_picture.f.motion_val[0][xy][0] = ((px + dmv_x + r_x) & ((r_x << 1) - 1)) - r_x;\n    s->mv[0][n][1] = s->current_picture.f.motion_val[0][xy][1] = ((py + dmv_y + r_y) & ((r_y << 1) - 1)) - r_y;\n    if (mvn == 1) {\n        s->current_picture.f.motion_val[0][xy +    1    ][0] = s->current_picture.f.motion_val[0][xy][0];\n        s->current_picture.f.motion_val[0][xy +    1    ][1] = s->current_picture.f.motion_val[0][xy][1];\n        s->current_picture.f.motion_val[0][xy + wrap    ][0] = s->current_picture.f.motion_val[0][xy][0];\n        s->current_picture.f.motion_val[0][xy + wrap    ][1] = s->current_picture.f.motion_val[0][xy][1];\n        s->current_picture.f.motion_val[0][xy + wrap + 1][0] = s->current_picture.f.motion_val[0][xy][0];\n        s->current_picture.f.motion_val[0][xy + wrap + 1][1] = s->current_picture.f.motion_val[0][xy][1];\n    } else if (mvn == 2) {\n        s->current_picture.f.motion_val[0][xy + 1][0] = s->current_picture.f.motion_val[0][xy][0];\n        s->current_picture.f.motion_val[0][xy + 1][1] = s->current_picture.f.motion_val[0][xy][1];\n        s->mv[0][n + 1][0] = s->mv[0][n][0];\n        s->mv[0][n + 1][1] = s->mv[0][n][1];\n    }\n}']