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

libavcodec/motion_est.c:978:1: start of procedure ff_estimate_p_frame_motion()
976. }
977. 
978. void ff_estimate_p_frame_motion(MpegEncContext * s,
     ^
979.                                 int mb_x, int mb_y)
980. {

libavcodec/motion_est.c:981:5: 
979.                                 int mb_x, int mb_y)
980. {
981.     MotionEstContext * const c= &s->me;
         ^
982.     uint8_t *pix, *ppix;
983.     int sum, mx, my, dmin;

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

libavcodec/motion_est.c:988:5: 
986.     int P[10][2];
987.     const int shift= 1+s->quarter_sample;
988.     int mb_type=0;
         ^
989.     Picture * const pic= &s->current_picture;
990. 

libavcodec/motion_est.c:989:5: 
987.     const int shift= 1+s->quarter_sample;
988.     int mb_type=0;
989.     Picture * const pic= &s->current_picture;
         ^
990. 
991.     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:991:5: 
989.     Picture * const pic= &s->current_picture;
990. 
991.     init_ref(c, s->new_picture.f.data, s->last_picture.f.data, NULL, 16*mb_x, 16*mb_y, 0);
         ^
992. 
993.     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.     }
