libavcodec/motion_est.c:1062: error: Null Dereference
  pointer `null` is dereferenced by call to `init_ref()` at line 1062, column 5.

libavcodec/motion_est.c:1054:1: start of procedure ff_pre_estimate_p_frame_motion()
1052. }
1053. 
1054. int ff_pre_estimate_p_frame_motion(MpegEncContext * s,
      ^
1055.                                     int mb_x, int mb_y)
1056. {

libavcodec/motion_est.c:1057:5: 
1055.                                     int mb_x, int mb_y)
1056. {
1057.     MotionEstContext * const c= &s->me;
          ^
1058.     int mx, my, dmin;
1059.     int P[10][2];

libavcodec/motion_est.c:1060:5: 
1058.     int mx, my, dmin;
1059.     int P[10][2];
1060.     const int shift= 1+s->quarter_sample;
          ^
1061.     const int xy= mb_x + mb_y*s->mb_stride;
1062.     init_ref(c, s->new_picture.f.data, s->last_picture.f.data, NULL, 16*mb_x, 16*mb_y, 0);

libavcodec/motion_est.c:1061:5: 
1059.     int P[10][2];
1060.     const int shift= 1+s->quarter_sample;
1061.     const int xy= mb_x + mb_y*s->mb_stride;
          ^
1062.     init_ref(c, s->new_picture.f.data, s->last_picture.f.data, NULL, 16*mb_x, 16*mb_y, 0);
1063. 

libavcodec/motion_est.c:1062:5: 
1060.     const int shift= 1+s->quarter_sample;
1061.     const int xy= mb_x + mb_y*s->mb_stride;
1062.     init_ref(c, s->new_picture.f.data, s->last_picture.f.data, NULL, 16*mb_x, 16*mb_y, 0);
          ^
1063. 
1064.     assert(s->quarter_sample==0 || s->quarter_sample==1);

libavcodec/motion_est.c:80:1: start of procedure init_ref()
  78. #define FLAG_DIRECT 4
  79. 
  80. static inline void init_ref(MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3], uint8_t *ref2[3], int x, int y, int ref_index){
      ^
  81.     const int offset[3]= {
  82.           y*c->  stride + x,

libavcodec/motion_est.c:81:5: 
  79. 
  80. static inline void init_ref(MotionEstContext *c, uint8_t *src[3], uint8_t *ref[3], uint8_t *ref2[3], int x, int y, int ref_index){
  81.     const int offset[3]= {
          ^
  82.           y*c->  stride + x,
  83.         ((y*c->uvstride + x)>>1),

libavcodec/motion_est.c:87:9: 
  85.     };
  86.     int i;
  87.     for(i=0; i<3; i++){
              ^
  88.         c->src[0][i]= src [i] + offset[i];
  89.         c->ref[0][i]= ref [i] + offset[i];

libavcodec/motion_est.c:87:14: Loop condition is true. Entering loop body
  85.     };
  86.     int i;
  87.     for(i=0; i<3; i++){
                   ^
  88.         c->src[0][i]= src [i] + offset[i];
  89.         c->ref[0][i]= ref [i] + offset[i];

libavcodec/motion_est.c:88:9: 
  86.     int i;
  87.     for(i=0; i<3; i++){
  88.         c->src[0][i]= src [i] + offset[i];
              ^
  89.         c->ref[0][i]= ref [i] + offset[i];
  90.     }

libavcodec/motion_est.c:89:9: 
  87.     for(i=0; i<3; i++){
  88.         c->src[0][i]= src [i] + offset[i];
  89.         c->ref[0][i]= ref [i] + offset[i];
              ^
  90.     }
  91.     if(ref_index){

libavcodec/motion_est.c:87:19: 
  85.     };
  86.     int i;
  87.     for(i=0; i<3; i++){
                        ^
  88.         c->src[0][i]= src [i] + offset[i];
  89.         c->ref[0][i]= ref [i] + offset[i];

libavcodec/motion_est.c:87:14: Loop condition is true. Entering loop body
  85.     };
  86.     int i;
  87.     for(i=0; i<3; i++){
                   ^
  88.         c->src[0][i]= src [i] + offset[i];
  89.         c->ref[0][i]= ref [i] + offset[i];

libavcodec/motion_est.c:88:9: 
  86.     int i;
  87.     for(i=0; i<3; i++){
  88.         c->src[0][i]= src [i] + offset[i];
              ^
  89.         c->ref[0][i]= ref [i] + offset[i];
  90.     }

libavcodec/motion_est.c:89:9: 
  87.     for(i=0; i<3; i++){
  88.         c->src[0][i]= src [i] + offset[i];
  89.         c->ref[0][i]= ref [i] + offset[i];
              ^
  90.     }
  91.     if(ref_index){

libavcodec/motion_est.c:87:19: 
  85.     };
  86.     int i;
  87.     for(i=0; i<3; i++){
                        ^
  88.         c->src[0][i]= src [i] + offset[i];
  89.         c->ref[0][i]= ref [i] + offset[i];

libavcodec/motion_est.c:87:14: Loop condition is false. Leaving loop
  85.     };
  86.     int i;
  87.     for(i=0; i<3; i++){
                   ^
  88.         c->src[0][i]= src [i] + offset[i];
  89.         c->ref[0][i]= ref [i] + offset[i];

libavcodec/motion_est.c:91:8: Taking true branch
  89.         c->ref[0][i]= ref [i] + offset[i];
  90.     }
  91.     if(ref_index){
             ^
  92.         for(i=0; i<3; i++){
  93.             c->ref[ref_index][i]= ref2[i] + offset[i];

libavcodec/motion_est.c:92:13: 
  90.     }
  91.     if(ref_index){
  92.         for(i=0; i<3; i++){
                  ^
  93.             c->ref[ref_index][i]= ref2[i] + offset[i];
  94.         }

libavcodec/motion_est.c:92:18: Loop condition is true. Entering loop body
  90.     }
  91.     if(ref_index){
  92.         for(i=0; i<3; i++){
                       ^
  93.             c->ref[ref_index][i]= ref2[i] + offset[i];
  94.         }

libavcodec/motion_est.c:93:13: 
  91.     if(ref_index){
  92.         for(i=0; i<3; i++){
  93.             c->ref[ref_index][i]= ref2[i] + offset[i];
                  ^
  94.         }
  95.     }
