libavcodec/imgconvert.c:639: error: Buffer Overrun L2
  Offset: [0, 90] Size: 64 by call to `avcodec_find_best_pix_fmt2`.

libavcodec/imgconvert.c:626:1: Array declaration
624. 
625. #if FF_API_FIND_BEST_PIX_FMT
626. enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,
     ^
627.                               int has_alpha, int *loss_ptr)
628. {

libavcodec/imgconvert.c:639:12: Call
637.     list[j] = PIX_FMT_NONE;
638. 
639.     return avcodec_find_best_pix_fmt2(list, src_pix_fmt, has_alpha, loss_ptr);
                ^
640. }
641. #endif /* FF_API_FIND_BEST_PIX_FMT */

libavcodec/imgconvert.c:643:1: Parameter `*pix_fmt_list`
  641. #endif /* FF_API_FIND_BEST_PIX_FMT */
  642. 
  643. enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list,
       ^
  644.                                             enum PixelFormat src_pix_fmt,
  645.                                             int has_alpha, int *loss_ptr)

libavcodec/imgconvert.c:663:23: Call
  661.     for(;;) {
  662.         loss_mask = loss_mask_order[i++];
  663.         dst_pix_fmt = avcodec_find_best_pix_fmt1(pix_fmt_list, src_pix_fmt,
                             ^
  664.                                                  has_alpha, loss_mask);
  665.         if (dst_pix_fmt >= 0)

libavcodec/imgconvert.c:602:5: <Offset trace>
600.     dst_pix_fmt = PIX_FMT_NONE;
601.     min_dist = 0x7fffffff;
602.     i = 0;
         ^
603.     while (pix_fmt_list[i] != PIX_FMT_NONE) {
604.         enum PixelFormat pix_fmt = pix_fmt_list[i];

libavcodec/imgconvert.c:602:5: Assignment
    600.     dst_pix_fmt = PIX_FMT_NONE;
    601.     min_dist = 0x7fffffff;
    602.     i = 0;
             ^
    603.     while (pix_fmt_list[i] != PIX_FMT_NONE) {
    604.         enum PixelFormat pix_fmt = pix_fmt_list[i];

libavcodec/imgconvert.c:591:1: <Length trace>
589. }
590. 
591. static enum PixelFormat avcodec_find_best_pix_fmt1(enum PixelFormat *pix_fmt_list,
     ^
592.                                       enum PixelFormat src_pix_fmt,
593.                                       int has_alpha,

libavcodec/imgconvert.c:591:1: Parameter `*pix_fmt_list`
    589. }
    590. 
    591. static enum PixelFormat avcodec_find_best_pix_fmt1(enum PixelFormat *pix_fmt_list,
         ^
    592.                                       enum PixelFormat src_pix_fmt,
    593.                                       int has_alpha,

libavcodec/imgconvert.c:603:12: Array access: Offset: [0, 90] Size: 64 by call to `avcodec_find_best_pix_fmt2` 
    601.     min_dist = 0x7fffffff;
    602.     i = 0;
    603.     while (pix_fmt_list[i] != PIX_FMT_NONE) {
                    ^
    604.         enum PixelFormat pix_fmt = pix_fmt_list[i];
    605. 

static enum PixelFormat avcodec_find_best_pix_fmt1(enum PixelFormat *pix_fmt_list,
                                      enum PixelFormat src_pix_fmt,
                                      int has_alpha,
                                      int loss_mask)
{
    int dist, i, loss, min_dist;
    enum PixelFormat dst_pix_fmt;
    dst_pix_fmt = PIX_FMT_NONE;
    min_dist = 0x7fffffff;
    i = 0;
    while (pix_fmt_list[i] != PIX_FMT_NONE) {
        enum PixelFormat pix_fmt = pix_fmt_list[i];
        if (i > PIX_FMT_NB) {
            av_log(NULL, AV_LOG_ERROR, "Pixel format list longer than expected, "
                   "it is either not properly terminated or contains duplicates\n");
            return PIX_FMT_NONE;
        }
        loss = avcodec_get_pix_fmt_loss(pix_fmt, src_pix_fmt, has_alpha) & loss_mask;
        if (loss == 0) {
            dist = avg_bits_per_pixel(pix_fmt);
            if (dist < min_dist) {
                min_dist = dist;
                dst_pix_fmt = pix_fmt;
            }
        }
        i++;
    }
    return dst_pix_fmt;
}
['enum PixelFormat avcodec_find_best_pix_fmt(int64_t pix_fmt_mask, enum PixelFormat src_pix_fmt,\n                              int has_alpha, int *loss_ptr)\n{\n    enum PixelFormat list[64];\n    int i, j = 0;\n    for (i = 0; i < 64; i++) {\n        if (pix_fmt_mask & (1ULL << i))\n            list[j++] = i;\n    }\n    list[j] = PIX_FMT_NONE;\n    return avcodec_find_best_pix_fmt2(list, src_pix_fmt, has_alpha, loss_ptr);\n}', 'enum PixelFormat avcodec_find_best_pix_fmt2(enum PixelFormat *pix_fmt_list,\n                                            enum PixelFormat src_pix_fmt,\n                                            int has_alpha, int *loss_ptr)\n{\n    enum PixelFormat dst_pix_fmt;\n    int loss_mask, i;\n    static const int loss_mask_order[] = {\n        ~0,\n        ~FF_LOSS_ALPHA,\n        ~FF_LOSS_RESOLUTION,\n        ~(FF_LOSS_COLORSPACE | FF_LOSS_RESOLUTION),\n        ~FF_LOSS_COLORQUANT,\n        ~FF_LOSS_DEPTH,\n        0,\n    };\n    i = 0;\n    for(;;) {\n        loss_mask = loss_mask_order[i++];\n        dst_pix_fmt = avcodec_find_best_pix_fmt1(pix_fmt_list, src_pix_fmt,\n                                                 has_alpha, loss_mask);\n        if (dst_pix_fmt >= 0)\n            goto found;\n        if (loss_mask == 0)\n            break;\n    }\n    return PIX_FMT_NONE;\n found:\n    if (loss_ptr)\n        *loss_ptr = avcodec_get_pix_fmt_loss(dst_pix_fmt, src_pix_fmt, has_alpha);\n    return dst_pix_fmt;\n}', 'static enum PixelFormat avcodec_find_best_pix_fmt1(enum PixelFormat *pix_fmt_list,\n                                      enum PixelFormat src_pix_fmt,\n                                      int has_alpha,\n                                      int loss_mask)\n{\n    int dist, i, loss, min_dist;\n    enum PixelFormat dst_pix_fmt;\n    dst_pix_fmt = PIX_FMT_NONE;\n    min_dist = 0x7fffffff;\n    i = 0;\n    while (pix_fmt_list[i] != PIX_FMT_NONE) {\n        enum PixelFormat pix_fmt = pix_fmt_list[i];\n        if (i > PIX_FMT_NB) {\n            av_log(NULL, AV_LOG_ERROR, "Pixel format list longer than expected, "\n                   "it is either not properly terminated or contains duplicates\\n");\n            return PIX_FMT_NONE;\n        }\n        loss = avcodec_get_pix_fmt_loss(pix_fmt, src_pix_fmt, has_alpha) & loss_mask;\n        if (loss == 0) {\n            dist = avg_bits_per_pixel(pix_fmt);\n            if (dist < min_dist) {\n                min_dist = dist;\n                dst_pix_fmt = pix_fmt;\n            }\n        }\n        i++;\n    }\n    return dst_pix_fmt;\n}']