libavcodec/imgconvert.c:61: error: Null Dereference
  pointer `src_desc` last assigned on line 59 could be null and is dereferenced at line 61, column 34.

libavcodec/imgconvert.c:55:1: start of procedure avcodec_get_pix_fmt_loss()
53. }
54. 
55. int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
    ^
56.                              enum AVPixelFormat src_pix_fmt,
57.                              int has_alpha)

libavcodec/imgconvert.c:59:5: 
57.                              int has_alpha)
58. {
59.     const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
        ^
60.     const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
61.     int loss, i, nb_components = FFMIN(src_desc->nb_components,

libavutil/pixdesc.c:1686:1: start of procedure av_pix_fmt_desc_get()
  1684. }
  1685. 
  1686. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1687. {
  1688.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1688:9: Taking false branch
  1686. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1687. {
  1688.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1689.         return NULL;
  1690.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1688:24: Taking true branch
  1686. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1687. {
  1688.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1689.         return NULL;
  1690.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1689:9: 
  1687. {
  1688.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1689.         return NULL;
                ^
  1690.     return &av_pix_fmt_descriptors[pix_fmt];
  1691. }

libavutil/pixdesc.c:1691:1: return from a call to av_pix_fmt_desc_get
  1689.         return NULL;
  1690.     return &av_pix_fmt_descriptors[pix_fmt];
  1691. }
        ^
  1692. 
  1693. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavcodec/imgconvert.c:60:5: 
58. {
59.     const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
60.     const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
        ^
61.     int loss, i, nb_components = FFMIN(src_desc->nb_components,
62.                                        dst_desc->nb_components);

libavutil/pixdesc.c:1686:1: start of procedure av_pix_fmt_desc_get()
  1684. }
  1685. 
  1686. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1687. {
  1688.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1688:9: Taking false branch
  1686. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1687. {
  1688.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1689.         return NULL;
  1690.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1688:24: Taking true branch
  1686. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1687. {
  1688.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1689.         return NULL;
  1690.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1689:9: 
  1687. {
  1688.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1689.         return NULL;
                ^
  1690.     return &av_pix_fmt_descriptors[pix_fmt];
  1691. }

libavutil/pixdesc.c:1691:1: return from a call to av_pix_fmt_desc_get
  1689.         return NULL;
  1690.     return &av_pix_fmt_descriptors[pix_fmt];
  1691. }
        ^
  1692. 
  1693. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavcodec/imgconvert.c:61:34: 
59.     const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
60.     const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
61.     int loss, i, nb_components = FFMIN(src_desc->nb_components,
                                     ^
62.                                        dst_desc->nb_components);
63. 

int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,
                             enum AVPixelFormat src_pix_fmt,
                             int has_alpha)
{
    const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);
    const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);
    int loss, i, nb_components = FFMIN(src_desc->nb_components,
                                       dst_desc->nb_components);
    loss = 0;
    if (dst_pix_fmt == src_pix_fmt)
        return 0;
    for (i = 0; i < nb_components; i++)
        if (src_desc->comp[i].depth > dst_desc->comp[i].depth)
            loss |= FF_LOSS_DEPTH;
    if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||
        dst_desc->log2_chroma_h > src_desc->log2_chroma_h)
        loss |= FF_LOSS_RESOLUTION;
    if ((src_desc->flags & AV_PIX_FMT_FLAG_RGB) != (dst_desc->flags & AV_PIX_FMT_FLAG_RGB))
        loss |= FF_LOSS_COLORSPACE;
    if (has_alpha && !(dst_desc->flags & AV_PIX_FMT_FLAG_ALPHA) &&
         (src_desc->flags & AV_PIX_FMT_FLAG_ALPHA))
        loss |= FF_LOSS_ALPHA;
    if (dst_pix_fmt == AV_PIX_FMT_PAL8 && !is_gray(src_desc))
        return loss | FF_LOSS_COLORQUANT;
    if (src_desc->nb_components > dst_desc->nb_components)
        if (is_gray(dst_desc))
            loss |= FF_LOSS_CHROMA;
    return loss;
}
['int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt,\n                             enum AVPixelFormat src_pix_fmt,\n                             int has_alpha)\n{\n    const AVPixFmtDescriptor *src_desc = av_pix_fmt_desc_get(src_pix_fmt);\n    const AVPixFmtDescriptor *dst_desc = av_pix_fmt_desc_get(dst_pix_fmt);\n    int loss, i, nb_components = FFMIN(src_desc->nb_components,\n                                       dst_desc->nb_components);\n    loss = 0;\n    if (dst_pix_fmt == src_pix_fmt)\n        return 0;\n    for (i = 0; i < nb_components; i++)\n        if (src_desc->comp[i].depth > dst_desc->comp[i].depth)\n            loss |= FF_LOSS_DEPTH;\n    if (dst_desc->log2_chroma_w > src_desc->log2_chroma_w ||\n        dst_desc->log2_chroma_h > src_desc->log2_chroma_h)\n        loss |= FF_LOSS_RESOLUTION;\n    if ((src_desc->flags & AV_PIX_FMT_FLAG_RGB) != (dst_desc->flags & AV_PIX_FMT_FLAG_RGB))\n        loss |= FF_LOSS_COLORSPACE;\n    if (has_alpha && !(dst_desc->flags & AV_PIX_FMT_FLAG_ALPHA) &&\n         (src_desc->flags & AV_PIX_FMT_FLAG_ALPHA))\n        loss |= FF_LOSS_ALPHA;\n    if (dst_pix_fmt == AV_PIX_FMT_PAL8 && !is_gray(src_desc))\n        return loss | FF_LOSS_COLORQUANT;\n    if (src_desc->nb_components > dst_desc->nb_components)\n        if (is_gray(dst_desc))\n            loss |= FF_LOSS_CHROMA;\n    return loss;\n}', 'const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)\n{\n    if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)\n        return NULL;\n    return &av_pix_fmt_descriptors[pix_fmt];\n}']