libavcodec/huffyuv.c:260: error: Buffer Overrun L2
  Offset: [2, 256] Size: 256 by call to `heap_sift`.

libavcodec/huffyuv.c:246:1: Array declaration
244. }
245. 
246. static void generate_len_table(uint8_t *dst, const uint64_t *stats)
     ^
247. {
248.     HeapElem h[256];

libavcodec/huffyuv.c:260:13: Call
258.         }
259.         for (i = size / 2 - 1; i >= 0; i--)
260.             heap_sift(h, i, size);
                 ^
261. 
262.         for (next = size; next < size * 2 - 1; next++) {

libavcodec/huffyuv.c:232:1: <Offset trace>
230. } HeapElem;
231. 
232. static void heap_sift(HeapElem *h, int root, int size)
     ^
233. {
234.     while (root * 2 + 1 < size) {

libavcodec/huffyuv.c:232:1: Parameter `size`
  230. } HeapElem;
  231. 
  232. static void heap_sift(HeapElem *h, int root, int size)
       ^
  233. {
  234.     while (root * 2 + 1 < size) {

libavcodec/huffyuv.c:232:1: <Length trace>
230. } HeapElem;
231. 
232. static void heap_sift(HeapElem *h, int root, int size)
     ^
233. {
234.     while (root * 2 + 1 < size) {

libavcodec/huffyuv.c:232:1: Parameter `*h`
  230. } HeapElem;
  231. 
  232. static void heap_sift(HeapElem *h, int root, int size)
       ^
  233. {
  234.     while (root * 2 + 1 < size) {

libavcodec/huffyuv.c:236:48: Array access: Offset: [2, 256] Size: 256 by call to `heap_sift` 
  234.     while (root * 2 + 1 < size) {
  235.         int child = root * 2 + 1;
  236.         if (child < size - 1 && h[child].val > h[child + 1].val)
                                                      ^
  237.             child++;
  238.         if (h[root].val > h[child].val) {

static void heap_sift(HeapElem *h, int root, int size)
{
    while (root * 2 + 1 < size) {
        int child = root * 2 + 1;
        if (child < size - 1 && h[child].val > h[child + 1].val)
            child++;
        if (h[root].val > h[child].val) {
            FFSWAP(HeapElem, h[root], h[child]);
            root = child;
        } else
            break;
    }
}
['static void generate_len_table(uint8_t *dst, const uint64_t *stats)\n{\n    HeapElem h[256];\n    int up[2*256];\n    int len[2*256];\n    int offset, i, next;\n    int size = 256;\n    for (offset = 1; ; offset <<= 1) {\n        for (i = 0; i < size; i++) {\n            h[i].name = i;\n            h[i].val = (stats[i] << 8) + offset;\n        }\n        for (i = size / 2 - 1; i >= 0; i--)\n            heap_sift(h, i, size);\n        for (next = size; next < size * 2 - 1; next++) {\n            uint64_t min1v = h[0].val;\n            up[h[0].name] = next;\n            h[0].val = INT64_MAX;\n            heap_sift(h, 0, size);\n            up[h[0].name] = next;\n            h[0].name = next;\n            h[0].val += min1v;\n            heap_sift(h, 0, size);\n        }\n        len[2 * size - 2] = 0;\n        for (i = 2 * size - 3; i >= size; i--)\n            len[i] = len[up[i]] + 1;\n        for (i = 0; i < size; i++) {\n            dst[i] = len[up[i]] + 1;\n            if (dst[i] >= 32) break;\n        }\n        if (i==size) break;\n    }\n}', 'static void heap_sift(HeapElem *h, int root, int size)\n{\n    while (root * 2 + 1 < size) {\n        int child = root * 2 + 1;\n        if (child < size - 1 && h[child].val > h[child + 1].val)\n            child++;\n        if (h[root].val > h[child].val) {\n            FFSWAP(HeapElem, h[root], h[child]);\n            root = child;\n        } else\n            break;\n    }\n}']