libavcodec/g722enc.c:345: 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:339:1: Parameter `c->prev_samples_pos`
337. }
338. 
339. static void g722_encode_no_trellis(G722Context *c,
     ^
340.                                    uint8_t *dst, int nb_samples,
341.                                    const int16_t *samples)

libavcodec/g722enc.c:345:9: Call
343.     int i;
344.     for (i = 0; i < nb_samples; i += 2)
345.         encode_byte(c, dst++, &samples[i]);
             ^
346. }
347. 

libavcodec/g722enc.c:326:1: Parameter `c->prev_samples_pos`
  324. }
  325. 
  326. static av_always_inline void encode_byte(G722Context *c, uint8_t *dst,
       ^
  327.                                          const int16_t *samples)
  328. {

libavcodec/g722enc.c:330:5: Call
  328. {
  329.     int xlow, xhigh, ilow, ihigh;
  330.     filter_samples(c, samples, &xlow, &xhigh);
           ^
  331.     ihigh = encode_high(&c->band[1], xhigh);
  332.     ilow  = encode_low (&c->band[0], xlow);

libavcodec/g722enc.c:132:1: <Offset trace>
130. };
131. 
132. static inline void filter_samples(G722Context *c, const int16_t *samples,
     ^
133.                                   int *xlow, int *xhigh)
134. {

libavcodec/g722enc.c:132:1: Parameter `c->prev_samples_pos`
    130. };
    131. 
    132. static inline void filter_samples(G722Context *c, const int16_t *samples,
         ^
    133.                                   int *xlow, int *xhigh)
    134. {

libavcodec/g722enc.c:136:21: Assignment
    134. {
    135.     int xout1, xout2;
    136.     c->prev_samples[c->prev_samples_pos++] = samples[0];
                             ^
    137.     c->prev_samples[c->prev_samples_pos++] = samples[1];
    138.     ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);

libavcodec/g722enc.c:132:1: <Length trace>
130. };
131. 
132. static inline void filter_samples(G722Context *c, const int16_t *samples,
     ^
133.                                   int *xlow, int *xhigh)
134. {

libavcodec/g722enc.c:132:1: Parameter `c->prev_samples[*]`
    130. };
    131. 
    132. static inline void filter_samples(G722Context *c, const int16_t *samples,
         ^
    133.                                   int *xlow, int *xhigh)
    134. {

libavcodec/g722enc.c:137: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` 
    135.     int xout1, xout2;
    136.     c->prev_samples[c->prev_samples_pos++] = samples[0];
    137.     c->prev_samples[c->prev_samples_pos++] = samples[1];
             ^
    138.     ff_g722_apply_qmf(c->prev_samples + c->prev_samples_pos - 24, &xout1, &xout2);
    139.     *xlow  = xout1 + xout2 >> 14;

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 >> 14;
    *xhigh = xout1 - xout2 >> 14;
    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 >> 14;\n    *xhigh = xout1 - xout2 >> 14;\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}']