libavcodec/dwt.c:610: error: Buffer Overrun L2
  Offset: [-1+max(3, `width`), max(2, `width`)] Size: `width`.

libavcodec/dwt.c:580:1: <Offset trace>
578. }
579. 
580. void ff_snow_horizontal_compose97i(IDWTELEM *b, int width)
     ^
581. {
582.     IDWTELEM temp[width];

libavcodec/dwt.c:580:1: Parameter `width`
578. }
579. 
580. void ff_snow_horizontal_compose97i(IDWTELEM *b, int width)
     ^
581. {
582.     IDWTELEM temp[width];

libavcodec/dwt.c:580:1: <Length trace>
578. }
579. 
580. void ff_snow_horizontal_compose97i(IDWTELEM *b, int width)
     ^
581. {
582.     IDWTELEM temp[width];

libavcodec/dwt.c:580:1: Parameter `width`
578. }
579. 
580. void ff_snow_horizontal_compose97i(IDWTELEM *b, int width)
     ^
581. {
582.     IDWTELEM temp[width];

libavcodec/dwt.c:582:19: Array declaration
580. void ff_snow_horizontal_compose97i(IDWTELEM *b, int width)
581. {
582.     IDWTELEM temp[width];
                       ^
583.     const int w2 = (width + 1) >> 1;
584. 

libavcodec/dwt.c:610:20: Array access: Offset: [-1+max(3, width), max(2, width)] Size: width
608.     }
609.     if (width & 1) {
610.         b[x]     = temp[x] + ((2 * temp[x] + temp[x - 1] + 4) >> 3);
                        ^
611.         b[x - 1] = temp[x - 1] + ((3 * (b[x - 2] + b[x])) >> 1);
612.     } else

void ff_snow_horizontal_compose97i(IDWTELEM *b, int width)
{
    IDWTELEM temp[width];
    const int w2 = (width + 1) >> 1;
#if 0
    inv_lift(temp,     b,      b + w2, 2, 1, 1, width, W_DM, W_DO, W_DS, 0, 1);
    inv_lift(temp + 1, b + w2, temp,   2, 1, 2, width, W_CM, W_CO, W_CS, 1, 1);
    inv_liftS(b,    temp,     temp + 1, 2, 2, 2, width, W_BM, W_BO, W_BS, 0, 1);
    inv_lift(b + 1, temp + 1, b,        2, 2, 2, width, W_AM, W_AO, W_AS, 1, 0);
#else
    int x;
    temp[0] = b[0] - ((3 * b[w2] + 2) >> 2);
    for (x = 1; x < (width >> 1); x++) {
        temp[2 * x]     = b[x] - ((3 * (b[x + w2 - 1] + b[x + w2]) + 4) >> 3);
        temp[2 * x - 1] = b[x + w2 - 1] - temp[2 * x - 2] - temp[2 * x];
    }
    if (width & 1) {
        temp[2 * x]     = b[x] - ((3 * b[x + w2 - 1] + 2) >> 2);
        temp[2 * x - 1] = b[x + w2 - 1] - temp[2 * x - 2] - temp[2 * x];
    } else
        temp[2 * x - 1] = b[x + w2 - 1] - 2 * temp[2 * x - 2];
    b[0] = temp[0] + ((2 * temp[0] + temp[1] + 4) >> 3);
    for (x = 2; x < width - 1; x += 2) {
        b[x]     = temp[x] + ((4 * temp[x] + temp[x - 1] + temp[x + 1] + 8) >> 4);
        b[x - 1] = temp[x - 1] + ((3 * (b[x - 2] + b[x])) >> 1);
    }
    if (width & 1) {
        b[x]     = temp[x] + ((2 * temp[x] + temp[x - 1] + 4) >> 3);
        b[x - 1] = temp[x - 1] + ((3 * (b[x - 2] + b[x])) >> 1);
    } else
        b[x - 1] = temp[x - 1] + 3 * b[x - 2];
#endif
}
['void ff_snow_horizontal_compose97i(IDWTELEM *b, int width)\n{\n    IDWTELEM temp[width];\n    const int w2 = (width + 1) >> 1;\n#if 0\n    inv_lift(temp,     b,      b + w2, 2, 1, 1, width, W_DM, W_DO, W_DS, 0, 1);\n    inv_lift(temp + 1, b + w2, temp,   2, 1, 2, width, W_CM, W_CO, W_CS, 1, 1);\n    inv_liftS(b,    temp,     temp + 1, 2, 2, 2, width, W_BM, W_BO, W_BS, 0, 1);\n    inv_lift(b + 1, temp + 1, b,        2, 2, 2, width, W_AM, W_AO, W_AS, 1, 0);\n#else\n    int x;\n    temp[0] = b[0] - ((3 * b[w2] + 2) >> 2);\n    for (x = 1; x < (width >> 1); x++) {\n        temp[2 * x]     = b[x] - ((3 * (b[x + w2 - 1] + b[x + w2]) + 4) >> 3);\n        temp[2 * x - 1] = b[x + w2 - 1] - temp[2 * x - 2] - temp[2 * x];\n    }\n    if (width & 1) {\n        temp[2 * x]     = b[x] - ((3 * b[x + w2 - 1] + 2) >> 2);\n        temp[2 * x - 1] = b[x + w2 - 1] - temp[2 * x - 2] - temp[2 * x];\n    } else\n        temp[2 * x - 1] = b[x + w2 - 1] - 2 * temp[2 * x - 2];\n    b[0] = temp[0] + ((2 * temp[0] + temp[1] + 4) >> 3);\n    for (x = 2; x < width - 1; x += 2) {\n        b[x]     = temp[x] + ((4 * temp[x] + temp[x - 1] + temp[x + 1] + 8) >> 4);\n        b[x - 1] = temp[x - 1] + ((3 * (b[x - 2] + b[x])) >> 1);\n    }\n    if (width & 1) {\n        b[x]     = temp[x] + ((2 * temp[x] + temp[x - 1] + 4) >> 3);\n        b[x - 1] = temp[x - 1] + ((3 * (b[x - 2] + b[x])) >> 1);\n    } else\n        b[x - 1] = temp[x - 1] + 3 * b[x - 2];\n#endif\n}']