libswscale/swscale_unscaled.c:589: error: Null Dereference
  pointer `desc_dst` last assigned on line 582 could be null and is dereferenced at line 589, column 39.

libswscale/swscale_unscaled.c:574:1: start of procedure findRgbConvFn()
572. /* {RGB,BGR}{15,16,24,32,32_1} -> {RGB,BGR}{15,16,24,32} */
573. typedef void (* rgbConvFn) (const uint8_t *, uint8_t *, int);
574. static rgbConvFn findRgbConvFn(SwsContext *c)
     ^
575. {
576.     const enum AVPixelFormat srcFormat = c->srcFormat;

libswscale/swscale_unscaled.c:576:5: 
574. static rgbConvFn findRgbConvFn(SwsContext *c)
575. {
576.     const enum AVPixelFormat srcFormat = c->srcFormat;
         ^
577.     const enum AVPixelFormat dstFormat = c->dstFormat;
578.     const int srcId = c->srcFormatBpp;

libswscale/swscale_unscaled.c:577:5: 
575. {
576.     const enum AVPixelFormat srcFormat = c->srcFormat;
577.     const enum AVPixelFormat dstFormat = c->dstFormat;
         ^
578.     const int srcId = c->srcFormatBpp;
579.     const int dstId = c->dstFormatBpp;

libswscale/swscale_unscaled.c:578:5: 
576.     const enum AVPixelFormat srcFormat = c->srcFormat;
577.     const enum AVPixelFormat dstFormat = c->dstFormat;
578.     const int srcId = c->srcFormatBpp;
         ^
579.     const int dstId = c->dstFormatBpp;
580.     rgbConvFn conv = NULL;

libswscale/swscale_unscaled.c:579:5: 
577.     const enum AVPixelFormat dstFormat = c->dstFormat;
578.     const int srcId = c->srcFormatBpp;
579.     const int dstId = c->dstFormatBpp;
         ^
580.     rgbConvFn conv = NULL;
581.     const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);

libswscale/swscale_unscaled.c:580:5: 
578.     const int srcId = c->srcFormatBpp;
579.     const int dstId = c->dstFormatBpp;
580.     rgbConvFn conv = NULL;
         ^
581.     const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);
582.     const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);

libswscale/swscale_unscaled.c:581:5: 
579.     const int dstId = c->dstFormatBpp;
580.     rgbConvFn conv = NULL;
581.     const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);
         ^
582.     const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);
583. 

libavutil/pixdesc.c:1507:1: start of procedure av_pix_fmt_desc_get()
  1505. }
  1506. 
  1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1508. {
  1509.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1509:9: Taking false branch
  1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1508. {
  1509.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1510.         return NULL;
  1511.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1509:24: Taking false branch
  1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1508. {
  1509.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1510.         return NULL;
  1511.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1511:5: 
  1509.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1510.         return NULL;
  1511.     return &av_pix_fmt_descriptors[pix_fmt];
            ^
  1512. }
  1513. 

libavutil/pixdesc.c:1512:1: return from a call to av_pix_fmt_desc_get
  1510.         return NULL;
  1511.     return &av_pix_fmt_descriptors[pix_fmt];
  1512. }
        ^
  1513. 
  1514. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libswscale/swscale_unscaled.c:582:5: 
580.     rgbConvFn conv = NULL;
581.     const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);
582.     const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);
         ^
583. 
584. #define IS_NOT_NE(bpp, desc) \

libavutil/pixdesc.c:1507:1: start of procedure av_pix_fmt_desc_get()
  1505. }
  1506. 
  1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1508. {
  1509.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1509:9: Taking false branch
  1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1508. {
  1509.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1510.         return NULL;
  1511.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1509:24: Taking true branch
  1507. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1508. {
  1509.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1510.         return NULL;
  1511.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1510:9: 
  1508. {
  1509.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1510.         return NULL;
                ^
  1511.     return &av_pix_fmt_descriptors[pix_fmt];
  1512. }

libavutil/pixdesc.c:1512:1: return from a call to av_pix_fmt_desc_get
  1510.         return NULL;
  1511.     return &av_pix_fmt_descriptors[pix_fmt];
  1512. }
        ^
  1513. 
  1514. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libswscale/swscale_unscaled.c:589:9: Taking false branch
587. 
588.     /* if this is non-native rgb444/555/565, don't handle it here. */
589.     if (IS_NOT_NE(srcId, desc_src) || IS_NOT_NE(dstId, desc_dst))
             ^
590.         return NULL;
591. 

libswscale/swscale_unscaled.c:589:39: Taking true branch
587. 
588.     /* if this is non-native rgb444/555/565, don't handle it here. */
589.     if (IS_NOT_NE(srcId, desc_src) || IS_NOT_NE(dstId, desc_dst))
                                           ^
590.         return NULL;
591. 

static rgbConvFn findRgbConvFn(SwsContext *c)
{
    const enum AVPixelFormat srcFormat = c->srcFormat;
    const enum AVPixelFormat dstFormat = c->dstFormat;
    const int srcId = c->srcFormatBpp;
    const int dstId = c->dstFormatBpp;
    rgbConvFn conv = NULL;
    const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);
    const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);
#define IS_NOT_NE(bpp, desc) \
    (((bpp + 7) >> 3) == 2 && \
     (!(desc->flags & AV_PIX_FMT_FLAG_BE) != !HAVE_BIGENDIAN))
    if (IS_NOT_NE(srcId, desc_src) || IS_NOT_NE(dstId, desc_dst))
        return NULL;
#define CONV_IS(src, dst) (srcFormat == AV_PIX_FMT_##src && dstFormat == AV_PIX_FMT_##dst)
    if (isRGBA32(srcFormat) && isRGBA32(dstFormat)) {
        if (     CONV_IS(ABGR, RGBA)
              || CONV_IS(ARGB, BGRA)
              || CONV_IS(BGRA, ARGB)
              || CONV_IS(RGBA, ABGR)) conv = shuffle_bytes_3210;
        else if (CONV_IS(ABGR, ARGB)
              || CONV_IS(ARGB, ABGR)) conv = shuffle_bytes_0321;
        else if (CONV_IS(ABGR, BGRA)
              || CONV_IS(ARGB, RGBA)) conv = shuffle_bytes_1230;
        else if (CONV_IS(BGRA, RGBA)
              || CONV_IS(RGBA, BGRA)) conv = shuffle_bytes_2103;
        else if (CONV_IS(BGRA, ABGR)
              || CONV_IS(RGBA, ARGB)) conv = shuffle_bytes_3012;
    } else
    if ((isBGRinInt(srcFormat) && isBGRinInt(dstFormat)) ||
        (isRGBinInt(srcFormat) && isRGBinInt(dstFormat))) {
        switch (srcId | (dstId << 16)) {
        case 0x000F000C: conv = rgb12to15; break;
        case 0x000F0010: conv = rgb16to15; break;
        case 0x000F0018: conv = rgb24to15; break;
        case 0x000F0020: conv = rgb32to15; break;
        case 0x0010000F: conv = rgb15to16; break;
        case 0x00100018: conv = rgb24to16; break;
        case 0x00100020: conv = rgb32to16; break;
        case 0x0018000F: conv = rgb15to24; break;
        case 0x00180010: conv = rgb16to24; break;
        case 0x00180020: conv = rgb32to24; break;
        case 0x0020000F: conv = rgb15to32; break;
        case 0x00200010: conv = rgb16to32; break;
        case 0x00200018: conv = rgb24to32; break;
        }
    } else if ((isBGRinInt(srcFormat) && isRGBinInt(dstFormat)) ||
               (isRGBinInt(srcFormat) && isBGRinInt(dstFormat))) {
        switch (srcId | (dstId << 16)) {
        case 0x000C000C: conv = rgb12tobgr12; break;
        case 0x000F000F: conv = rgb15tobgr15; break;
        case 0x000F0010: conv = rgb16tobgr15; break;
        case 0x000F0018: conv = rgb24tobgr15; break;
        case 0x000F0020: conv = rgb32tobgr15; break;
        case 0x0010000F: conv = rgb15tobgr16; break;
        case 0x00100010: conv = rgb16tobgr16; break;
        case 0x00100018: conv = rgb24tobgr16; break;
        case 0x00100020: conv = rgb32tobgr16; break;
        case 0x0018000F: conv = rgb15tobgr24; break;
        case 0x00180010: conv = rgb16tobgr24; break;
        case 0x00180018: conv = rgb24tobgr24; break;
        case 0x00180020: conv = rgb32tobgr24; break;
        case 0x0020000F: conv = rgb15tobgr32; break;
        case 0x00200010: conv = rgb16tobgr32; break;
        case 0x00200018: conv = rgb24tobgr32; break;
        }
    }
    return conv;
}
['static rgbConvFn findRgbConvFn(SwsContext *c)\n{\n    const enum AVPixelFormat srcFormat = c->srcFormat;\n    const enum AVPixelFormat dstFormat = c->dstFormat;\n    const int srcId = c->srcFormatBpp;\n    const int dstId = c->dstFormatBpp;\n    rgbConvFn conv = NULL;\n    const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);\n    const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);\n#define IS_NOT_NE(bpp, desc) \\\n    (((bpp + 7) >> 3) == 2 && \\\n     (!(desc->flags & AV_PIX_FMT_FLAG_BE) != !HAVE_BIGENDIAN))\n    if (IS_NOT_NE(srcId, desc_src) || IS_NOT_NE(dstId, desc_dst))\n        return NULL;\n#define CONV_IS(src, dst) (srcFormat == AV_PIX_FMT_##src && dstFormat == AV_PIX_FMT_##dst)\n    if (isRGBA32(srcFormat) && isRGBA32(dstFormat)) {\n        if (     CONV_IS(ABGR, RGBA)\n              || CONV_IS(ARGB, BGRA)\n              || CONV_IS(BGRA, ARGB)\n              || CONV_IS(RGBA, ABGR)) conv = shuffle_bytes_3210;\n        else if (CONV_IS(ABGR, ARGB)\n              || CONV_IS(ARGB, ABGR)) conv = shuffle_bytes_0321;\n        else if (CONV_IS(ABGR, BGRA)\n              || CONV_IS(ARGB, RGBA)) conv = shuffle_bytes_1230;\n        else if (CONV_IS(BGRA, RGBA)\n              || CONV_IS(RGBA, BGRA)) conv = shuffle_bytes_2103;\n        else if (CONV_IS(BGRA, ABGR)\n              || CONV_IS(RGBA, ARGB)) conv = shuffle_bytes_3012;\n    } else\n    if ((isBGRinInt(srcFormat) && isBGRinInt(dstFormat)) ||\n        (isRGBinInt(srcFormat) && isRGBinInt(dstFormat))) {\n        switch (srcId | (dstId << 16)) {\n        case 0x000F000C: conv = rgb12to15; break;\n        case 0x000F0010: conv = rgb16to15; break;\n        case 0x000F0018: conv = rgb24to15; break;\n        case 0x000F0020: conv = rgb32to15; break;\n        case 0x0010000F: conv = rgb15to16; break;\n        case 0x00100018: conv = rgb24to16; break;\n        case 0x00100020: conv = rgb32to16; break;\n        case 0x0018000F: conv = rgb15to24; break;\n        case 0x00180010: conv = rgb16to24; break;\n        case 0x00180020: conv = rgb32to24; break;\n        case 0x0020000F: conv = rgb15to32; break;\n        case 0x00200010: conv = rgb16to32; break;\n        case 0x00200018: conv = rgb24to32; break;\n        }\n    } else if ((isBGRinInt(srcFormat) && isRGBinInt(dstFormat)) ||\n               (isRGBinInt(srcFormat) && isBGRinInt(dstFormat))) {\n        switch (srcId | (dstId << 16)) {\n        case 0x000C000C: conv = rgb12tobgr12; break;\n        case 0x000F000F: conv = rgb15tobgr15; break;\n        case 0x000F0010: conv = rgb16tobgr15; break;\n        case 0x000F0018: conv = rgb24tobgr15; break;\n        case 0x000F0020: conv = rgb32tobgr15; break;\n        case 0x0010000F: conv = rgb15tobgr16; break;\n        case 0x00100010: conv = rgb16tobgr16; break;\n        case 0x00100018: conv = rgb24tobgr16; break;\n        case 0x00100020: conv = rgb32tobgr16; break;\n        case 0x0018000F: conv = rgb15tobgr24; break;\n        case 0x00180010: conv = rgb16tobgr24; break;\n        case 0x00180018: conv = rgb24tobgr24; break;\n        case 0x00180020: conv = rgb32tobgr24; break;\n        case 0x0020000F: conv = rgb15tobgr32; break;\n        case 0x00200010: conv = rgb16tobgr32; break;\n        case 0x00200018: conv = rgb24tobgr32; break;\n        }\n    }\n    return conv;\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}']