libavcodec/g722enc.c:152: error: Buffer Overrun L2
  Offset: [1+min(22, `avctx->priv_data->prev_samples_pos`), 1+max(1023, `avctx->priv_data->prev_samples_pos`)] Size: 1024 by call to `filter_samples`.

libavcodec/g722enc.c:120:1: Parameter `avctx->priv_data->prev_samples_pos`
118. }
119. 
120. static int g722_encode_trellis(AVCodecContext *avctx,
     ^
121.                                uint8_t *dst, int buf_size, void *data)
122. {

libavcodec/g722enc.c:152:9: Call
150.         }
151. 
152.         filter_samples(c, &samples[2*i], &xlow, &xhigh);
             ^
153. 
154.         for (j = 0; j < frontier && nodes[0][j]; j++) {

libavcodec/g722enc.c:81:1: <Offset trace>
79. };
80. 
81. static inline void filter_samples(G722Context *c, const int16_t *samples,
    ^
82.                                   int *xlow, int *xhigh)
83. {

libavcodec/g722enc.c:81:1: Parameter `c->prev_samples_pos`
  79. };
  80. 
  81. static inline void filter_samples(G722Context *c, const int16_t *samples,
      ^
  82.                                   int *xlow, int *xhigh)
  83. {

libavcodec/g722enc.c:85:21: Assignment
  83. {
  84.     int xout1, xout2;
  85.     c->prev_samples[c->prev_samples_pos++] = samples[0];
                          ^
  86.     c->prev_samples[c->prev_samples_pos++] = samples[1];
  87.     ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);

libavcodec/g722enc.c:81:1: <Length trace>
79. };
80. 
81. static inline void filter_samples(G722Context *c, const int16_t *samples,
    ^
82.                                   int *xlow, int *xhigh)
83. {

libavcodec/g722enc.c:81:1: Parameter `c->prev_samples[*]`
  79. };
  80. 
  81. static inline void filter_samples(G722Context *c, const int16_t *samples,
      ^
  82.                                   int *xlow, int *xhigh)
  83. {

libavcodec/g722enc.c:86:5: Array access: Offset: [1+min(22, avctx->priv_data->prev_samples_pos), 1+max(1023, avctx->priv_data->prev_samples_pos)] Size: 1024 by call to `filter_samples` 
  84.     int xout1, xout2;
  85.     c->prev_samples[c->prev_samples_pos++] = samples[0];
  86.     c->prev_samples[c->prev_samples_pos++] = samples[1];
          ^
  87.     ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);
  88.     *xlow  = xout1 + xout2 >> 13;
