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

libavcodec/motion_est.c:1263:1: start of procedure ff_pre_estimate_p_frame_motion()
1261. }
1262. 
1263. int ff_pre_estimate_p_frame_motion(MpegEncContext * s,
      ^
1264.                                     int mb_x, int mb_y)
1265. {

libavcodec/motion_est.c:1266:5: 
1264.                                     int mb_x, int mb_y)
1265. {
1266.     MotionEstContext * const c= &s->me;
          ^
1267.     int mx, my, dmin;
1268.     int P[10][2];

libavcodec/motion_est.c:1269:5: 
1267.     int mx, my, dmin;
1268.     int P[10][2];
1269.     const int shift= 1+s->quarter_sample;
          ^
1270.     const int xy= mb_x + mb_y*s->mb_stride;
1271.     init_ref(c, s->new_picture.data, s->last_picture.data, NULL, 16*mb_x, 16*mb_y, 0);

libavcodec/motion_est.c:1270:5: 
1268.     int P[10][2];
1269.     const int shift= 1+s->quarter_sample;
1270.     const int xy= mb_x + mb_y*s->mb_stride;
          ^
1271.     init_ref(c, s->new_picture.data, s->last_picture.data, NULL, 16*mb_x, 16*mb_y, 0);
1272. 

libavcodec/motion_est.c:1271:5: 
1269.     const int shift= 1+s->quarter_sample;
1270.     const int xy= mb_x + mb_y*s->mb_stride;
1271.     init_ref(c, s->new_picture.data, s->last_picture.data, NULL, 16*mb_x, 16*mb_y, 0);
          ^
1272. 
1273.     assert(s->quarter_sample==0 || s->quarter_sample==1);

libavcodec/motion_est.c:83:1: start of procedure init_ref()
  81. #define FLAG_DIRECT 4
  82. 
  83. 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){
      ^
  84.     const int offset[3]= {
  85.           y*c->  stride + x,

libavcodec/motion_est.c:84:5: 
  82. 
  83. 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){
  84.     const int offset[3]= {
          ^
  85.           y*c->  stride + x,
  86.         ((y*c->uvstride + x)>>1),

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

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

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

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

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

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

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

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

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

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

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

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

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

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