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

libavcodec/g722enc.c:344:1: Parameter `c->prev_samples_pos`
342. }
343. 
344. static void g722_encode_no_trellis(G722Context *c,
     ^
345.                                    uint8_t *dst, int nb_samples,
346.                                    const int16_t *samples)

libavcodec/g722enc.c:350:9: Call
348.     int i;
349.     for (i = 0; i < nb_samples; i += 2)
350.         encode_byte(c, dst++, &samples[i]);
             ^
351. }
352. 

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, c->prev_samples_pos), 1+max(1023, c->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;
