libavfilter/vf_scale.c:288: error: Buffer Overrun L2
  Offset: [0, 255] Size: 16 by call to `sws_scale`.

libavfilter/vf_scale.c:260:1: Parameter `in->data[*]`
258. }
259. 
260. static int filter_frame(AVFilterLink *link, AVFrame *in)
     ^
261. {
262.     ScaleContext *scale = link->dst->priv;

libavfilter/vf_scale.c:288:5: Call
286.               INT_MAX);
287. 
288.     sws_scale(scale->sws, in->data, in->linesize, 0, in->height,
         ^
289.               out->data, out->linesize);
290. 

libswscale/swscale_unscaled.c:1161:14: <Offset trace>
1159. 
1160.     if (usePal(c->srcFormat)) {
1161.         for (i = 0; i < 256; i++) {
                   ^
1162.             int p, r, g, b, y, u, v;
1163.             if (c->srcFormat == AV_PIX_FMT_PAL8) {

libswscale/swscale_unscaled.c:1161:14: Assignment
  1159. 
  1160.     if (usePal(c->srcFormat)) {
  1161.         for (i = 0; i < 256; i++) {
                     ^
  1162.             int p, r, g, b, y, u, v;
  1163.             if (c->srcFormat == AV_PIX_FMT_PAL8) {

libswscale/swscale_unscaled.c:1129:1: <Length trace>
1127.  * Assumes planar YUV to be in YUV order instead of YVU.
1128.  */
1129. int attribute_align_arg sws_scale(struct SwsContext *c,
      ^
1130.                                   const uint8_t * const srcSlice[],
1131.                                   const int srcStride[], int srcSliceY,

libswscale/swscale_unscaled.c:1129:1: Parameter `**srcSlice`
  1127.  * Assumes planar YUV to be in YUV order instead of YVU.
  1128.  */
  1129. int attribute_align_arg sws_scale(struct SwsContext *c,
        ^
  1130.                                   const uint8_t * const srcSlice[],
  1131.                                   const int srcStride[], int srcSliceY,

libswscale/swscale_unscaled.c:1164:21: Array access: Offset: [0, 255] Size: 16 by call to `sws_scale` 
  1162.             int p, r, g, b, y, u, v;
  1163.             if (c->srcFormat == AV_PIX_FMT_PAL8) {
  1164.                 p = ((const uint32_t *)(srcSlice[1]))[i];
                            ^
  1165.                 r = (p >> 16) & 0xFF;
  1166.                 g = (p >>  8) & 0xFF;

int attribute_align_arg sws_scale(struct SwsContext *c,
                                  const uint8_t * const srcSlice[],
                                  const int srcStride[], int srcSliceY,
                                  int srcSliceH, uint8_t *const dst[],
                                  const int dstStride[])
{
    int i;
    const uint8_t *src2[4] = { srcSlice[0], srcSlice[1], srcSlice[2], srcSlice[3] };
    uint8_t *dst2[4] = { dst[0], dst[1], dst[2], dst[3] };
    if (srcSliceH == 0)
        return 0;
    if (!check_image_pointers(srcSlice, c->srcFormat, srcStride)) {
        av_log(c, AV_LOG_ERROR, "bad src image pointers\n");
        return 0;
    }
    if (!check_image_pointers(dst, c->dstFormat, dstStride)) {
        av_log(c, AV_LOG_ERROR, "bad dst image pointers\n");
        return 0;
    }
    if (c->sliceDir == 0 && srcSliceY != 0 && srcSliceY + srcSliceH != c->srcH) {
        av_log(c, AV_LOG_ERROR, "Slices start in the middle!\n");
        return 0;
    }
    if (c->sliceDir == 0) {
        if (srcSliceY == 0) c->sliceDir = 1; else c->sliceDir = -1;
    }
    if (usePal(c->srcFormat)) {
        for (i = 0; i < 256; i++) {
            int p, r, g, b, y, u, v;
            if (c->srcFormat == AV_PIX_FMT_PAL8) {
                p = ((const uint32_t *)(srcSlice[1]))[i];
                r = (p >> 16) & 0xFF;
                g = (p >>  8) & 0xFF;
                b =  p        & 0xFF;
            } else if (c->srcFormat == AV_PIX_FMT_RGB8) {
                r = ( i >> 5     ) * 36;
                g = ((i >> 2) & 7) * 36;
                b = ( i       & 3) * 85;
            } else if (c->srcFormat == AV_PIX_FMT_BGR8) {
                b = ( i >> 6     ) * 85;
                g = ((i >> 3) & 7) * 36;
                r = ( i       & 7) * 36;
            } else if (c->srcFormat == AV_PIX_FMT_RGB4_BYTE) {
                r = ( i >> 3     ) * 255;
                g = ((i >> 1) & 3) * 85;
                b = ( i       & 1) * 255;
            } else if (c->srcFormat == AV_PIX_FMT_GRAY8 ||
                      c->srcFormat == AV_PIX_FMT_Y400A) {
                r = g = b = i;
            } else {
                assert(c->srcFormat == AV_PIX_FMT_BGR4_BYTE);
                b = ( i >> 3     ) * 255;
                g = ((i >> 1) & 3) * 85;
                r = ( i       & 1) * 255;
            }
            y = av_clip_uint8((RY * r + GY * g + BY * b + ( 33 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
            u = av_clip_uint8((RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
            v = av_clip_uint8((RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);
            c->pal_yuv[i] = y + (u << 8) + (v << 16);
            switch (c->dstFormat) {
            case AV_PIX_FMT_BGR32:
#if !HAVE_BIGENDIAN
            case AV_PIX_FMT_RGB24:
#endif
                c->pal_rgb[i] =  r + (g << 8) + (b << 16);
                break;
            case AV_PIX_FMT_BGR32_1:
#if HAVE_BIGENDIAN
            case AV_PIX_FMT_BGR24:
#endif
                c->pal_rgb[i] = (r + (g << 8) + (b << 16)) << 8;
                break;
            case AV_PIX_FMT_RGB32_1:
#if HAVE_BIGENDIAN
            case AV_PIX_FMT_RGB24:
#endif
                c->pal_rgb[i] = (b + (g << 8) + (r << 16)) << 8;
                break;
            case AV_PIX_FMT_RGB32:
#if !HAVE_BIGENDIAN
            case AV_PIX_FMT_BGR24:
#endif
            default:
                c->pal_rgb[i] =  b + (g << 8) + (r << 16);
            }
        }
    }
    if (c->sliceDir == 1) {
        int srcStride2[4] = { srcStride[0], srcStride[1], srcStride[2],
                              srcStride[3] };
        int dstStride2[4] = { dstStride[0], dstStride[1], dstStride[2],
                              dstStride[3] };
        reset_ptr(src2, c->srcFormat);
        reset_ptr((const uint8_t **) dst2, c->dstFormat);
        if (srcSliceY + srcSliceH == c->srcH)
            c->sliceDir = 0;
        return c->swScale(c, src2, srcStride2, srcSliceY, srcSliceH, dst2,
                          dstStride2);
    } else {
        int srcStride2[4] = { -srcStride[0], -srcStride[1], -srcStride[2],
                              -srcStride[3] };
        int dstStride2[4] = { -dstStride[0], -dstStride[1], -dstStride[2],
                              -dstStride[3] };
        src2[0] += (srcSliceH - 1) * srcStride[0];
        if (!usePal(c->srcFormat))
            src2[1] += ((srcSliceH >> c->chrSrcVSubSample) - 1) * srcStride[1];
        src2[2] += ((srcSliceH >> c->chrSrcVSubSample) - 1) * srcStride[2];
        src2[3] += (srcSliceH - 1) * srcStride[3];
        dst2[0] += ( c->dstH                         - 1) * dstStride[0];
        dst2[1] += ((c->dstH >> c->chrDstVSubSample) - 1) * dstStride[1];
        dst2[2] += ((c->dstH >> c->chrDstVSubSample) - 1) * dstStride[2];
        dst2[3] += ( c->dstH                         - 1) * dstStride[3];
        reset_ptr(src2, c->srcFormat);
        reset_ptr((const uint8_t **) dst2, c->dstFormat);
        if (!srcSliceY)
            c->sliceDir = 0;
        return c->swScale(c, src2, srcStride2, c->srcH-srcSliceY-srcSliceH,
                          srcSliceH, dst2, dstStride2);
    }
}
['static int filter_frame(AVFilterLink *link, AVFrame *in)\n{\n    ScaleContext *scale = link->dst->priv;\n    AVFilterLink *outlink = link->dst->outputs[0];\n    AVFrame *out;\n    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(link->format);\n    if (!scale->sws)\n        return ff_filter_frame(outlink, in);\n    scale->hsub = desc->log2_chroma_w;\n    scale->vsub = desc->log2_chroma_h;\n    out = ff_get_video_buffer(outlink, outlink->w, outlink->h);\n    if (!out) {\n        av_frame_free(&in);\n        return AVERROR(ENOMEM);\n    }\n    av_frame_copy_props(out, in);\n    out->width  = outlink->w;\n    out->height = outlink->h;\n    av_reduce(&out->sample_aspect_ratio.num, &out->sample_aspect_ratio.den,\n              (int64_t)in->sample_aspect_ratio.num * outlink->h * link->w,\n              (int64_t)in->sample_aspect_ratio.den * outlink->w * link->h,\n              INT_MAX);\n    sws_scale(scale->sws, in->data, in->linesize, 0, in->height,\n              out->data, out->linesize);\n    av_frame_free(&in);\n    return ff_filter_frame(outlink, out);\n}', 'int attribute_align_arg sws_scale(struct SwsContext *c,\n                                  const uint8_t * const srcSlice[],\n                                  const int srcStride[], int srcSliceY,\n                                  int srcSliceH, uint8_t *const dst[],\n                                  const int dstStride[])\n{\n    int i;\n    const uint8_t *src2[4] = { srcSlice[0], srcSlice[1], srcSlice[2], srcSlice[3] };\n    uint8_t *dst2[4] = { dst[0], dst[1], dst[2], dst[3] };\n    if (srcSliceH == 0)\n        return 0;\n    if (!check_image_pointers(srcSlice, c->srcFormat, srcStride)) {\n        av_log(c, AV_LOG_ERROR, "bad src image pointers\\n");\n        return 0;\n    }\n    if (!check_image_pointers(dst, c->dstFormat, dstStride)) {\n        av_log(c, AV_LOG_ERROR, "bad dst image pointers\\n");\n        return 0;\n    }\n    if (c->sliceDir == 0 && srcSliceY != 0 && srcSliceY + srcSliceH != c->srcH) {\n        av_log(c, AV_LOG_ERROR, "Slices start in the middle!\\n");\n        return 0;\n    }\n    if (c->sliceDir == 0) {\n        if (srcSliceY == 0) c->sliceDir = 1; else c->sliceDir = -1;\n    }\n    if (usePal(c->srcFormat)) {\n        for (i = 0; i < 256; i++) {\n            int p, r, g, b, y, u, v;\n            if (c->srcFormat == AV_PIX_FMT_PAL8) {\n                p = ((const uint32_t *)(srcSlice[1]))[i];\n                r = (p >> 16) & 0xFF;\n                g = (p >>  8) & 0xFF;\n                b =  p        & 0xFF;\n            } else if (c->srcFormat == AV_PIX_FMT_RGB8) {\n                r = ( i >> 5     ) * 36;\n                g = ((i >> 2) & 7) * 36;\n                b = ( i       & 3) * 85;\n            } else if (c->srcFormat == AV_PIX_FMT_BGR8) {\n                b = ( i >> 6     ) * 85;\n                g = ((i >> 3) & 7) * 36;\n                r = ( i       & 7) * 36;\n            } else if (c->srcFormat == AV_PIX_FMT_RGB4_BYTE) {\n                r = ( i >> 3     ) * 255;\n                g = ((i >> 1) & 3) * 85;\n                b = ( i       & 1) * 255;\n            } else if (c->srcFormat == AV_PIX_FMT_GRAY8 ||\n                      c->srcFormat == AV_PIX_FMT_Y400A) {\n                r = g = b = i;\n            } else {\n                assert(c->srcFormat == AV_PIX_FMT_BGR4_BYTE);\n                b = ( i >> 3     ) * 255;\n                g = ((i >> 1) & 3) * 85;\n                r = ( i       & 1) * 255;\n            }\n            y = av_clip_uint8((RY * r + GY * g + BY * b + ( 33 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);\n            u = av_clip_uint8((RU * r + GU * g + BU * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);\n            v = av_clip_uint8((RV * r + GV * g + BV * b + (257 << (RGB2YUV_SHIFT - 1))) >> RGB2YUV_SHIFT);\n            c->pal_yuv[i] = y + (u << 8) + (v << 16);\n            switch (c->dstFormat) {\n            case AV_PIX_FMT_BGR32:\n#if !HAVE_BIGENDIAN\n            case AV_PIX_FMT_RGB24:\n#endif\n                c->pal_rgb[i] =  r + (g << 8) + (b << 16);\n                break;\n            case AV_PIX_FMT_BGR32_1:\n#if HAVE_BIGENDIAN\n            case AV_PIX_FMT_BGR24:\n#endif\n                c->pal_rgb[i] = (r + (g << 8) + (b << 16)) << 8;\n                break;\n            case AV_PIX_FMT_RGB32_1:\n#if HAVE_BIGENDIAN\n            case AV_PIX_FMT_RGB24:\n#endif\n                c->pal_rgb[i] = (b + (g << 8) + (r << 16)) << 8;\n                break;\n            case AV_PIX_FMT_RGB32:\n#if !HAVE_BIGENDIAN\n            case AV_PIX_FMT_BGR24:\n#endif\n            default:\n                c->pal_rgb[i] =  b + (g << 8) + (r << 16);\n            }\n        }\n    }\n    if (c->sliceDir == 1) {\n        int srcStride2[4] = { srcStride[0], srcStride[1], srcStride[2],\n                              srcStride[3] };\n        int dstStride2[4] = { dstStride[0], dstStride[1], dstStride[2],\n                              dstStride[3] };\n        reset_ptr(src2, c->srcFormat);\n        reset_ptr((const uint8_t **) dst2, c->dstFormat);\n        if (srcSliceY + srcSliceH == c->srcH)\n            c->sliceDir = 0;\n        return c->swScale(c, src2, srcStride2, srcSliceY, srcSliceH, dst2,\n                          dstStride2);\n    } else {\n        int srcStride2[4] = { -srcStride[0], -srcStride[1], -srcStride[2],\n                              -srcStride[3] };\n        int dstStride2[4] = { -dstStride[0], -dstStride[1], -dstStride[2],\n                              -dstStride[3] };\n        src2[0] += (srcSliceH - 1) * srcStride[0];\n        if (!usePal(c->srcFormat))\n            src2[1] += ((srcSliceH >> c->chrSrcVSubSample) - 1) * srcStride[1];\n        src2[2] += ((srcSliceH >> c->chrSrcVSubSample) - 1) * srcStride[2];\n        src2[3] += (srcSliceH - 1) * srcStride[3];\n        dst2[0] += ( c->dstH                         - 1) * dstStride[0];\n        dst2[1] += ((c->dstH >> c->chrDstVSubSample) - 1) * dstStride[1];\n        dst2[2] += ((c->dstH >> c->chrDstVSubSample) - 1) * dstStride[2];\n        dst2[3] += ( c->dstH                         - 1) * dstStride[3];\n        reset_ptr(src2, c->srcFormat);\n        reset_ptr((const uint8_t **) dst2, c->dstFormat);\n        if (!srcSliceY)\n            c->sliceDir = 0;\n        return c->swScale(c, src2, srcStride2, c->srcH-srcSliceY-srcSliceH,\n                          srcSliceH, dst2, dstStride2);\n    }\n}']