libavcodec/g722enc.c:337: 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:331:1: Parameter `c->prev_samples_pos`
329. }
330. 
331. static void g722_encode_no_trellis(G722Context *c,
     ^
332.                                    uint8_t *dst, int nb_samples,
333.                                    const int16_t *samples)

libavcodec/g722enc.c:337:9: Call
335.     int i;
336.     for (i = 0; i < nb_samples; i += 2)
337.         encode_byte(c, dst++, &samples[i]);
             ^
338. }
339. 

libavcodec/g722enc.c:318:1: Parameter `c->prev_samples_pos`
  316. }
  317. 
  318. static av_always_inline void encode_byte(G722Context *c, uint8_t *dst,
       ^
  319.                                          const int16_t *samples)
  320. {

libavcodec/g722enc.c:322:5: Call
  320. {
  321.     int xlow, xhigh, ilow, ihigh;
  322.     filter_samples(c, samples, &xlow, &xhigh);
           ^
  323.     ihigh = encode_high(&c->band[1], xhigh);
  324.     ilow  = encode_low (&c->band[0], xlow);

libavcodec/g722enc.c:124:1: <Offset trace>
122. };
123. 
124. static inline void filter_samples(G722Context *c, const int16_t *samples,
     ^
125.                                   int *xlow, int *xhigh)
126. {

libavcodec/g722enc.c:124:1: Parameter `c->prev_samples_pos`
    122. };
    123. 
    124. static inline void filter_samples(G722Context *c, const int16_t *samples,
         ^
    125.                                   int *xlow, int *xhigh)
    126. {

libavcodec/g722enc.c:128:21: Assignment
    126. {
    127.     int xout1, xout2;
    128.     c->prev_samples[c->prev_samples_pos++] = samples[0];
                             ^
    129.     c->prev_samples[c->prev_samples_pos++] = samples[1];
    130.     ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);

libavcodec/g722enc.c:124:1: <Length trace>
122. };
123. 
124. static inline void filter_samples(G722Context *c, const int16_t *samples,
     ^
125.                                   int *xlow, int *xhigh)
126. {

libavcodec/g722enc.c:124:1: Parameter `c->prev_samples[*]`
    122. };
    123. 
    124. static inline void filter_samples(G722Context *c, const int16_t *samples,
         ^
    125.                                   int *xlow, int *xhigh)
    126. {

libavcodec/g722enc.c:129: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` 
    127.     int xout1, xout2;
    128.     c->prev_samples[c->prev_samples_pos++] = samples[0];
    129.     c->prev_samples[c->prev_samples_pos++] = samples[1];
             ^
    130.     ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);
    131.     *xlow  = xout1 + xout2 >> 13;

static inline void filter_samples(G722Context *c, const int16_t *samples,
                                  int *xlow, int *xhigh)
{
    int xout1, xout2;
    c->prev_samples[c->prev_samples_pos++] = samples[0];
    c->prev_samples[c->prev_samples_pos++] = samples[1];
    ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);
    *xlow  = xout1 + xout2 >> 13;
    *xhigh = xout1 - xout2 >> 13;
    if (c->prev_samples_pos >= PREV_SAMPLES_BUF_SIZE) {
        memmove(c->prev_samples,
                c->prev_samples + c->prev_samples_pos - 22,
                22 * sizeof(c->prev_samples[0]));
        c->prev_samples_pos = 22;
    }
}
['static void g722_encode_no_trellis(G722Context *c,\n                                   uint8_t *dst, int nb_samples,\n                                   const int16_t *samples)\n{\n    int i;\n    for (i = 0; i < nb_samples; i += 2)\n        encode_byte(c, dst++, &samples[i]);\n}', 'static av_always_inline void encode_byte(G722Context *c, uint8_t *dst,\n                                         const int16_t *samples)\n{\n    int xlow, xhigh, ilow, ihigh;\n    filter_samples(c, samples, &xlow, &xhigh);\n    ihigh = encode_high(&c->band[1], xhigh);\n    ilow  = encode_low (&c->band[0], xlow);\n    ff_g722_update_high_predictor(&c->band[1], c->band[1].scale_factor *\n                                ff_g722_high_inv_quant[ihigh] >> 10, ihigh);\n    ff_g722_update_low_predictor(&c->band[0], ilow >> 2);\n    *dst = ihigh << 6 | ilow;\n}', 'static inline void filter_samples(G722Context *c, const int16_t *samples,\n                                  int *xlow, int *xhigh)\n{\n    int xout1, xout2;\n    c->prev_samples[c->prev_samples_pos++] = samples[0];\n    c->prev_samples[c->prev_samples_pos++] = samples[1];\n    ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);\n    *xlow  = xout1 + xout2 >> 13;\n    *xhigh = xout1 - xout2 >> 13;\n    if (c->prev_samples_pos >= PREV_SAMPLES_BUF_SIZE) {\n        memmove(c->prev_samples,\n                c->prev_samples + c->prev_samples_pos - 22,\n                22 * sizeof(c->prev_samples[0]));\n        c->prev_samples_pos = 22;\n    }\n}']