libavcodec/g722.c:422: 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/g722.c:390:1: Parameter `avctx->priv_data->prev_samples_pos`
388. }
389. 
390. static int g722_encode_trellis(AVCodecContext *avctx,
     ^
391.                                uint8_t *dst, int buf_size, void *data)
392. {

libavcodec/g722.c:422:9: Call
420.         }
421. 
422.         filter_samples(c, &samples[2*i], &xlow, &xhigh);
             ^
423. 
424.         for (j = 0; j < frontier && nodes[0][j]; j++) {

libavcodec/g722.c:351:1: <Offset trace>
349. };
350. 
351. static inline void filter_samples(G722Context *c, const int16_t *samples,
     ^
352.                                   int *xlow, int *xhigh)
353. {

libavcodec/g722.c:351:1: Parameter `c->prev_samples_pos`
  349. };
  350. 
  351. static inline void filter_samples(G722Context *c, const int16_t *samples,
       ^
  352.                                   int *xlow, int *xhigh)
  353. {

libavcodec/g722.c:355:21: Assignment
  353. {
  354.     int xout1, xout2;
  355.     c->prev_samples[c->prev_samples_pos++] = samples[0];
                           ^
  356.     c->prev_samples[c->prev_samples_pos++] = samples[1];
  357.     apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);

libavcodec/g722.c:351:1: <Length trace>
349. };
350. 
351. static inline void filter_samples(G722Context *c, const int16_t *samples,
     ^
352.                                   int *xlow, int *xhigh)
353. {

libavcodec/g722.c:351:1: Parameter `c->prev_samples[*]`
  349. };
  350. 
  351. static inline void filter_samples(G722Context *c, const int16_t *samples,
       ^
  352.                                   int *xlow, int *xhigh)
  353. {

libavcodec/g722.c:356: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` 
  354.     int xout1, xout2;
  355.     c->prev_samples[c->prev_samples_pos++] = samples[0];
  356.     c->prev_samples[c->prev_samples_pos++] = samples[1];
           ^
  357.     apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);
  358.     *xlow  = xout1 + xout2 >> 13;
