libavcodec/motion_est_template.c:215: error: Uninitialized Value
  The value read from ymax was never initialized.

libavcodec/motion_est_template.c:215:9: 
213.             CHECK_HALF_MV(0, 1, mx  , my)
214.         }
215.         assert(bx >= xmin*2 && bx <= xmax*2 && by >= ymin*2 && by <= ymax*2);
             ^
216.     }
217. 

static int hpel_motion_search(MpegEncContext * s,
                                  int *mx_ptr, int *my_ptr, int dmin,
                                  int src_index, int ref_index,
                                  int size, int h)
{
    MotionEstContext * const c= &s->me;
    const int mx = *mx_ptr;
    const int my = *my_ptr;
    const int penalty_factor= c->sub_penalty_factor;
    me_cmp_func cmp_sub, chroma_cmp_sub;
    int bx=2*mx, by=2*my;
    LOAD_COMMON
    int flags= c->sub_flags;
    cmp_sub= s->dsp.me_sub_cmp[size];
    chroma_cmp_sub= s->dsp.me_sub_cmp[size+1];
    if(c->skip){
        *mx_ptr = 0;
        *my_ptr = 0;
        return dmin;
    }
    if(c->avctx->me_cmp != c->avctx->me_sub_cmp){
        dmin= cmp(s, mx, my, 0, 0, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);
        if(mx || my || size>0)
            dmin += (mv_penalty[2*mx - pred_x] + mv_penalty[2*my - pred_y])*penalty_factor;
    }
    if (mx > xmin && mx < xmax &&
        my > ymin && my < ymax) {
        int d= dmin;
        const int index= (my<<ME_MAP_SHIFT) + mx;
        const int t= score_map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
                     + (mv_penalty[bx   - pred_x] + mv_penalty[by-2 - pred_y])*c->penalty_factor;
        const int l= score_map[(index- 1               )&(ME_MAP_SIZE-1)]
                     + (mv_penalty[bx-2 - pred_x] + mv_penalty[by   - pred_y])*c->penalty_factor;
        const int r= score_map[(index+ 1               )&(ME_MAP_SIZE-1)]
                     + (mv_penalty[bx+2 - pred_x] + mv_penalty[by   - pred_y])*c->penalty_factor;
        const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]
                     + (mv_penalty[bx   - pred_x] + mv_penalty[by+2 - pred_y])*c->penalty_factor;
#if 1
        int key;
        int map_generation= c->map_generation;
#ifndef NDEBUG
        uint32_t *map= c->map;
#endif
        key= ((my-1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
        assert(map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);
        key= ((my+1)<<ME_MAP_MV_BITS) + (mx) + map_generation;
        assert(map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);
        key= ((my)<<ME_MAP_MV_BITS) + (mx+1) + map_generation;
        assert(map[(index+1)&(ME_MAP_SIZE-1)] == key);
        key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation;
        assert(map[(index-1)&(ME_MAP_SIZE-1)] == key);
#endif
        if(t<=b){
            CHECK_HALF_MV(0, 1, mx  ,my-1)
            if(l<=r){
                CHECK_HALF_MV(1, 1, mx-1, my-1)
                if(t+r<=b+l){
                    CHECK_HALF_MV(1, 1, mx  , my-1)
                }else{
                    CHECK_HALF_MV(1, 1, mx-1, my  )
                }
                CHECK_HALF_MV(1, 0, mx-1, my  )
            }else{
                CHECK_HALF_MV(1, 1, mx  , my-1)
                if(t+l<=b+r){
                    CHECK_HALF_MV(1, 1, mx-1, my-1)
                }else{
                    CHECK_HALF_MV(1, 1, mx  , my  )
                }
                CHECK_HALF_MV(1, 0, mx  , my  )
            }
        }else{
            if(l<=r){
                if(t+l<=b+r){
                    CHECK_HALF_MV(1, 1, mx-1, my-1)
                }else{
                    CHECK_HALF_MV(1, 1, mx  , my  )
                }
                CHECK_HALF_MV(1, 0, mx-1, my)
                CHECK_HALF_MV(1, 1, mx-1, my)
            }else{
                if(t+r<=b+l){
                    CHECK_HALF_MV(1, 1, mx  , my-1)
                }else{
                    CHECK_HALF_MV(1, 1, mx-1, my)
                }
                CHECK_HALF_MV(1, 0, mx  , my)
                CHECK_HALF_MV(1, 1, mx  , my)
            }
            CHECK_HALF_MV(0, 1, mx  , my)
        }
        assert(bx >= xmin*2 && bx <= xmax*2 && by >= ymin*2 && by <= ymax*2);
    }
    *mx_ptr = bx;
    *my_ptr = by;
    return dmin;
}
['static int hpel_motion_search(MpegEncContext * s,\n                                  int *mx_ptr, int *my_ptr, int dmin,\n                                  int src_index, int ref_index,\n                                  int size, int h)\n{\n    MotionEstContext * const c= &s->me;\n    const int mx = *mx_ptr;\n    const int my = *my_ptr;\n    const int penalty_factor= c->sub_penalty_factor;\n    me_cmp_func cmp_sub, chroma_cmp_sub;\n    int bx=2*mx, by=2*my;\n    LOAD_COMMON\n    int flags= c->sub_flags;\n    cmp_sub= s->dsp.me_sub_cmp[size];\n    chroma_cmp_sub= s->dsp.me_sub_cmp[size+1];\n    if(c->skip){\n        *mx_ptr = 0;\n        *my_ptr = 0;\n        return dmin;\n    }\n    if(c->avctx->me_cmp != c->avctx->me_sub_cmp){\n        dmin= cmp(s, mx, my, 0, 0, size, h, ref_index, src_index, cmp_sub, chroma_cmp_sub, flags);\n        if(mx || my || size>0)\n            dmin += (mv_penalty[2*mx - pred_x] + mv_penalty[2*my - pred_y])*penalty_factor;\n    }\n    if (mx > xmin && mx < xmax &&\n        my > ymin && my < ymax) {\n        int d= dmin;\n        const int index= (my<<ME_MAP_SHIFT) + mx;\n        const int t= score_map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]\n                     + (mv_penalty[bx   - pred_x] + mv_penalty[by-2 - pred_y])*c->penalty_factor;\n        const int l= score_map[(index- 1               )&(ME_MAP_SIZE-1)]\n                     + (mv_penalty[bx-2 - pred_x] + mv_penalty[by   - pred_y])*c->penalty_factor;\n        const int r= score_map[(index+ 1               )&(ME_MAP_SIZE-1)]\n                     + (mv_penalty[bx+2 - pred_x] + mv_penalty[by   - pred_y])*c->penalty_factor;\n        const int b= score_map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)]\n                     + (mv_penalty[bx   - pred_x] + mv_penalty[by+2 - pred_y])*c->penalty_factor;\n#if 1\n        int key;\n        int map_generation= c->map_generation;\n#ifndef NDEBUG\n        uint32_t *map= c->map;\n#endif\n        key= ((my-1)<<ME_MAP_MV_BITS) + (mx) + map_generation;\n        assert(map[(index-(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);\n        key= ((my+1)<<ME_MAP_MV_BITS) + (mx) + map_generation;\n        assert(map[(index+(1<<ME_MAP_SHIFT))&(ME_MAP_SIZE-1)] == key);\n        key= ((my)<<ME_MAP_MV_BITS) + (mx+1) + map_generation;\n        assert(map[(index+1)&(ME_MAP_SIZE-1)] == key);\n        key= ((my)<<ME_MAP_MV_BITS) + (mx-1) + map_generation;\n        assert(map[(index-1)&(ME_MAP_SIZE-1)] == key);\n#endif\n        if(t<=b){\n            CHECK_HALF_MV(0, 1, mx  ,my-1)\n            if(l<=r){\n                CHECK_HALF_MV(1, 1, mx-1, my-1)\n                if(t+r<=b+l){\n                    CHECK_HALF_MV(1, 1, mx  , my-1)\n                }else{\n                    CHECK_HALF_MV(1, 1, mx-1, my  )\n                }\n                CHECK_HALF_MV(1, 0, mx-1, my  )\n            }else{\n                CHECK_HALF_MV(1, 1, mx  , my-1)\n                if(t+l<=b+r){\n                    CHECK_HALF_MV(1, 1, mx-1, my-1)\n                }else{\n                    CHECK_HALF_MV(1, 1, mx  , my  )\n                }\n                CHECK_HALF_MV(1, 0, mx  , my  )\n            }\n        }else{\n            if(l<=r){\n                if(t+l<=b+r){\n                    CHECK_HALF_MV(1, 1, mx-1, my-1)\n                }else{\n                    CHECK_HALF_MV(1, 1, mx  , my  )\n                }\n                CHECK_HALF_MV(1, 0, mx-1, my)\n                CHECK_HALF_MV(1, 1, mx-1, my)\n            }else{\n                if(t+r<=b+l){\n                    CHECK_HALF_MV(1, 1, mx  , my-1)\n                }else{\n                    CHECK_HALF_MV(1, 1, mx-1, my)\n                }\n                CHECK_HALF_MV(1, 0, mx  , my)\n                CHECK_HALF_MV(1, 1, mx  , my)\n            }\n            CHECK_HALF_MV(0, 1, mx  , my)\n        }\n        assert(bx >= xmin*2 && bx <= xmax*2 && by >= ymin*2 && by <= ymax*2);\n    }\n    *mx_ptr = bx;\n    *my_ptr = by;\n    return dmin;\n}']