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

libavcodec/motion_est.c:848:1: start of procedure ff_estimate_p_frame_motion()
846. }
847. 
848. void ff_estimate_p_frame_motion(MpegEncContext * s,
     ^
849.                                 int mb_x, int mb_y)
850. {

libavcodec/motion_est.c:851:5: 
849.                                 int mb_x, int mb_y)
850. {
851.     MotionEstContext * const c= &s->me;
         ^
852.     uint8_t *pix, *ppix;
853.     int sum, mx, my, dmin;

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

libavcodec/motion_est.c:858:5: 
856.     int P[10][2];
857.     const int shift= 1+s->quarter_sample;
858.     int mb_type=0;
         ^
859.     Picture * const pic= &s->current_picture;
860. 

libavcodec/motion_est.c:859:5: 
857.     const int shift= 1+s->quarter_sample;
858.     int mb_type=0;
859.     Picture * const pic= &s->current_picture;
         ^
860. 
861.     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:861:5: 
859.     Picture * const pic= &s->current_picture;
860. 
861.     init_ref(c, s->new_picture.f.data, s->last_picture.f.data, NULL, 16*mb_x, 16*mb_y, 0);
         ^
862. 
863.     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.     }
