libavcodec/g722enc.c:384: 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:361:1: Parameter `avctx->priv_data->prev_samples_pos`
359. }
360. 
361. static int g722_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
     ^
362.                              const AVFrame *frame, int *got_packet_ptr)
363. {

libavcodec/g722enc.c:377:9: Call
375. 
376.     if (avctx->trellis)
377.         g722_encode_trellis(c, avctx->trellis, avpkt->data, nb_samples, samples);
             ^
378.     else
379.         g722_encode_no_trellis(c, avpkt->data, nb_samples, samples);

libavcodec/g722enc.c:184:1: Parameter `c->prev_samples_pos`
  182. }
  183. 
  184. static void g722_encode_trellis(G722Context *c, int trellis,
       ^
  185.                                 uint8_t *dst, int nb_samples,
  186.                                 const int16_t *samples)

libavcodec/g722enc.c:384:9: Call
382.     if (nb_samples < frame->nb_samples) {
383.         int16_t last_samples[2] = { samples[nb_samples], samples[nb_samples] };
384.         encode_byte(c, &avpkt->data[nb_samples >> 1], last_samples);
             ^
385.     }
386. 

libavcodec/g722enc.c:339:1: Parameter `c->prev_samples_pos`
  337. }
  338. 
  339. static av_always_inline void encode_byte(G722Context *c, uint8_t *dst,
       ^
  340.                                          const int16_t *samples)
  341. {

libavcodec/g722enc.c:343:5: Call
  341. {
  342.     int xlow, xhigh, ilow, ihigh;
  343.     filter_samples(c, samples, &xlow, &xhigh);
           ^
  344.     ihigh = encode_high(&c->band[1], xhigh);
  345.     ilow  = encode_low (&c->band[0], xlow);

libavcodec/g722enc.c:145:1: <Offset trace>
143. };
144. 
145. static inline void filter_samples(G722Context *c, const int16_t *samples,
     ^
146.                                   int *xlow, int *xhigh)
147. {

libavcodec/g722enc.c:145:1: Parameter `c->prev_samples_pos`
    143. };
    144. 
    145. static inline void filter_samples(G722Context *c, const int16_t *samples,
         ^
    146.                                   int *xlow, int *xhigh)
    147. {

libavcodec/g722enc.c:149:21: Assignment
    147. {
    148.     int xout1, xout2;
    149.     c->prev_samples[c->prev_samples_pos++] = samples[0];
                             ^
    150.     c->prev_samples[c->prev_samples_pos++] = samples[1];
    151.     ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);

libavcodec/g722enc.c:145:1: <Length trace>
143. };
144. 
145. static inline void filter_samples(G722Context *c, const int16_t *samples,
     ^
146.                                   int *xlow, int *xhigh)
147. {

libavcodec/g722enc.c:145:1: Parameter `c->prev_samples[*]`
    143. };
    144. 
    145. static inline void filter_samples(G722Context *c, const int16_t *samples,
         ^
    146.                                   int *xlow, int *xhigh)
    147. {

libavcodec/g722enc.c:150: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` 
    148.     int xout1, xout2;
    149.     c->prev_samples[c->prev_samples_pos++] = samples[0];
    150.     c->prev_samples[c->prev_samples_pos++] = samples[1];
             ^
    151.     ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);
    152.     *xlow  = xout1 + xout2 >> 14;
