libavcodec/g722enc.c:376: 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 `encode_byte`.

libavcodec/g722enc.c:353:1: Parameter `avctx->priv_data->prev_samples_pos`
351. }
352. 
353. static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     ^
354.                              const AVFrame *frame, int *got_packet_ptr)
355. {

libavcodec/g722enc.c:369:9: Call
367. 
368.     if (avctx->trellis)
369.         g722_encode_trellis(c, avctx->trellis, avpkt->data, nb_samples, samples);
             ^
370.     else
371.         g722_encode_no_trellis(c, avpkt->data, nb_samples, samples);

libavcodec/g722enc.c:176:1: Parameter `c->prev_samples_pos`
  174. }
  175. 
  176. static void g722_encode_trellis(G722Context *c, int trellis,
       ^
  177.                                 uint8_t *dst, int nb_samples,
  178.                                 const int16_t *samples)

libavcodec/g722enc.c:376:9: Call
374.     if (nb_samples < frame->nb_samples) {
375.         int16_t last_samples[2] = { samples[nb_samples], samples[nb_samples] };
376.         encode_byte(c, &avpkt->data[nb_samples >> 1], last_samples);
             ^
377.     }
378. 

libavcodec/g722enc.c:331:1: Parameter `c->prev_samples_pos`
  329. }
  330. 
  331. static av_always_inline void encode_byte(G722Context *c, uint8_t *dst,
       ^
  332.                                          const int16_t *samples)
  333. {

libavcodec/g722enc.c:335:5: Call
  333. {
  334.     int xlow, xhigh, ilow, ihigh;
  335.     filter_samples(c, samples, &xlow, &xhigh);
           ^
  336.     ihigh = encode_high(&c->band[1], xhigh);
  337.     ilow  = encode_low (&c->band[0], xlow);

libavcodec/g722enc.c:137:1: <Offset trace>
135. };
136. 
137. static inline void filter_samples(G722Context *c, const int16_t *samples,
     ^
138.                                   int *xlow, int *xhigh)
139. {

libavcodec/g722enc.c:137:1: Parameter `c->prev_samples_pos`
    135. };
    136. 
    137. static inline void filter_samples(G722Context *c, const int16_t *samples,
         ^
    138.                                   int *xlow, int *xhigh)
    139. {

libavcodec/g722enc.c:141:21: Assignment
    139. {
    140.     int xout[2];
    141.     c->prev_samples[c->prev_samples_pos++] = samples[0];
                             ^
    142.     c->prev_samples[c->prev_samples_pos++] = samples[1];
    143.     c->dsp.apply_qmf(c->prev_samples + c->prev_samples_pos - 24, xout);

libavcodec/g722enc.c:137:1: <Length trace>
135. };
136. 
137. static inline void filter_samples(G722Context *c, const int16_t *samples,
     ^
138.                                   int *xlow, int *xhigh)
139. {

libavcodec/g722enc.c:137:1: Parameter `c->prev_samples[*]`
    135. };
    136. 
    137. static inline void filter_samples(G722Context *c, const int16_t *samples,
         ^
    138.                                   int *xlow, int *xhigh)
    139. {

libavcodec/g722enc.c:142: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 `encode_byte` 
    140.     int xout[2];
    141.     c->prev_samples[c->prev_samples_pos++] = samples[0];
    142.     c->prev_samples[c->prev_samples_pos++] = samples[1];
             ^
    143.     c->dsp.apply_qmf(c->prev_samples + c->prev_samples_pos - 24, xout);
    144.     *xlow  = xout[0] + xout[1] >> 14;
