libavcodec/dxtory.c:224: error: Buffer Overrun L2
  Offset: [0, 4] Size: 3 by call to `decode_sym_565`.

libavcodec/dxtory.c:211:1: Array declaration
209. }
210. 
211. static int dx2_decode_slice_565(GetBitContext *gb, int width, int height,
     ^
212.                                 uint8_t *dst, int stride, int is_565)
213. {

libavcodec/dxtory.c:224:17: Call
222.     for (y = 0; y < height; y++) {
223.         for (x = 0; x < width; x++) {
224.             b = decode_sym_565(gb, lru[0], 5);
                     ^
225.             g = decode_sym_565(gb, lru[1], is_565 ? 6 : 5);
226.             r = decode_sym_565(gb, lru[2], 5);

libavcodec/dxtory.c:193:1: <Offset trace>
191. }
192. 
193. static inline uint8_t decode_sym_565(GetBitContext *gb, uint8_t lru[8],
     ^
194.                                      int bits)
195. {

libavcodec/dxtory.c:193:1: Parameter `bits`
  191. }
  192. 
  193. static inline uint8_t decode_sym_565(GetBitContext *gb, uint8_t lru[8],
       ^
  194.                                      int bits)
  195. {

libavcodec/dxtory.c:198:9: Call
  196.     uint8_t c, val;
  197. 
  198.     c = get_unary(gb, 0, bits);
               ^
  199.     if (!c) {
  200.         val = get_bits(gb, bits);

libavcodec/unary.h:33:1: Parameter `len`
    31.  * @return Unary length/index
    32.  */
    33. static inline int get_unary(GetBitContext *gb, int stop, int len)
        ^
    34. {
    35.     int i;

libavcodec/unary.h:38:5: Assignment
    36. 
    37.     for(i = 0; i < len && get_bits1(gb) != stop; i++);
    38.     return i;
            ^
    39. }
    40. 

libavcodec/dxtory.c:198:5: Assignment
  196.     uint8_t c, val;
  197. 
  198.     c = get_unary(gb, 0, bits);
           ^
  199.     if (!c) {
  200.         val = get_bits(gb, bits);

libavcodec/dxtory.c:193:1: <Length trace>
191. }
192. 
193. static inline uint8_t decode_sym_565(GetBitContext *gb, uint8_t lru[8],
     ^
194.                                      int bits)
195. {

libavcodec/dxtory.c:193:1: Parameter `*lru`
  191. }
  192. 
  193. static inline uint8_t decode_sym_565(GetBitContext *gb, uint8_t lru[8],
       ^
  194.                                      int bits)
  195. {

libavcodec/dxtory.c:203:15: Array access: Offset: [0, 4] Size: 3 by call to `decode_sym_565` 
  201.         memmove(lru + 1, lru, sizeof(*lru) * (6 - 1));
  202.     } else {
  203.         val = lru[c - 1];
                     ^
  204.         memmove(lru + 1, lru, sizeof(*lru) * (c - 1));
  205.     }

static inline uint8_t decode_sym_565(GetBitContext *gb, uint8_t lru[8],
                                     int bits)
{
    uint8_t c, val;
    c = get_unary(gb, 0, bits);
    if (!c) {
        val = get_bits(gb, bits);
        memmove(lru + 1, lru, sizeof(*lru) * (6 - 1));
    } else {
        val = lru[c - 1];
        memmove(lru + 1, lru, sizeof(*lru) * (c - 1));
    }
    lru[0] = val;
    return val;
}
['static int dx2_decode_slice_565(GetBitContext *gb, int width, int height,\n                                uint8_t *dst, int stride, int is_565)\n{\n    int x, y;\n    int r, g, b;\n    uint8_t lru[3][8];\n    memcpy(lru[0], def_lru_555, 8 * sizeof(*def_lru));\n    memcpy(lru[1], is_565 ? def_lru_565 : def_lru_555, 8 * sizeof(*def_lru));\n    memcpy(lru[2], def_lru_555, 8 * sizeof(*def_lru));\n    for (y = 0; y < height; y++) {\n        for (x = 0; x < width; x++) {\n            b = decode_sym_565(gb, lru[0], 5);\n            g = decode_sym_565(gb, lru[1], is_565 ? 6 : 5);\n            r = decode_sym_565(gb, lru[2], 5);\n            dst[x * 3 + 0] = (r << 3) | (r >> 2);\n            dst[x * 3 + 1] = is_565 ? (g << 2) | (g >> 4) : (g << 3) | (g >> 2);\n            dst[x * 3 + 2] = (b << 3) | (b >> 2);\n        }\n        dst += stride;\n    }\n    return 0;\n}', 'static inline uint8_t decode_sym_565(GetBitContext *gb, uint8_t lru[8],\n                                     int bits)\n{\n    uint8_t c, val;\n    c = get_unary(gb, 0, bits);\n    if (!c) {\n        val = get_bits(gb, bits);\n        memmove(lru + 1, lru, sizeof(*lru) * (6 - 1));\n    } else {\n        val = lru[c - 1];\n        memmove(lru + 1, lru, sizeof(*lru) * (c - 1));\n    }\n    lru[0] = val;\n    return val;\n}', 'static inline int get_unary(GetBitContext *gb, int stop, int len)\n{\n    int i;\n    for(i = 0; i < len && get_bits1(gb) != stop; i++);\n    return i;\n}']