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

libavcodec/motion_est.c:995:1: start of procedure ff_estimate_p_frame_motion()
993. }
994. 
995. void ff_estimate_p_frame_motion(MpegEncContext * s,
     ^
996.                                 int mb_x, int mb_y)
997. {

libavcodec/motion_est.c:998:5: 
 996.                                 int mb_x, int mb_y)
 997. {
 998.     MotionEstContext * const c= &s->me;
          ^
 999.     uint8_t *pix, *ppix;
1000.     int sum, mx, my, dmin;

libavcodec/motion_est.c:1004:5: 
1002.     int vard;            ///< sum of squared differences with the estimated motion vector
1003.     int P[10][2];
1004.     const int shift= 1+s->quarter_sample;
          ^
1005.     int mb_type=0;
1006.     Picture * const pic= &s->current_picture;

libavcodec/motion_est.c:1005:5: 
1003.     int P[10][2];
1004.     const int shift= 1+s->quarter_sample;
1005.     int mb_type=0;
          ^
1006.     Picture * const pic= &s->current_picture;
1007. 

libavcodec/motion_est.c:1006:5: 
1004.     const int shift= 1+s->quarter_sample;
1005.     int mb_type=0;
1006.     Picture * const pic= &s->current_picture;
          ^
1007. 
1008.     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:1008:5: 
1006.     Picture * const pic= &s->current_picture;
1007. 
1008.     init_ref(c, s->new_picture.f.data, s->last_picture.f.data, NULL, 16*mb_x, 16*mb_y, 0);
          ^
1009. 
1010.     assert(s->quarter_sample==0 || s->quarter_sample==1);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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