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

libavcodec/motion_est.c:859:1: start of procedure ff_estimate_p_frame_motion()
857. }
858. 
859. void ff_estimate_p_frame_motion(MpegEncContext * s,
     ^
860.                                 int mb_x, int mb_y)
861. {

libavcodec/motion_est.c:862:5: 
860.                                 int mb_x, int mb_y)
861. {
862.     MotionEstContext * const c= &s->me;
         ^
863.     uint8_t *pix, *ppix;
864.     int sum, mx, my, dmin;

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

libavcodec/motion_est.c:869:5: 
867.     int P[10][2];
868.     const int shift= 1+s->quarter_sample;
869.     int mb_type=0;
         ^
870.     Picture * const pic= &s->current_picture;
871. 

libavcodec/motion_est.c:870:5: 
868.     const int shift= 1+s->quarter_sample;
869.     int mb_type=0;
870.     Picture * const pic= &s->current_picture;
         ^
871. 
872.     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:872:5: 
870.     Picture * const pic= &s->current_picture;
871. 
872.     init_ref(c, s->new_picture.f->data, s->last_picture.f->data, NULL, 16*mb_x, 16*mb_y, 0);
         ^
873. 
874.     assert(s->quarter_sample==0 || s->quarter_sample==1);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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