libswscale/swscale_unscaled.c:474: error: Null Dereference
  pointer `desc_src` last assigned on line 466 could be null and is dereferenced at line 474, column 9.

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

libswscale/swscale_unscaled.c:461:5: 
459. static rgbConvFn findRgbConvFn(SwsContext *c)
460. {
461.     const enum AVPixelFormat srcFormat = c->srcFormat;
         ^
462.     const enum AVPixelFormat dstFormat = c->dstFormat;
463.     const int srcId = c->srcFormatBpp;

libswscale/swscale_unscaled.c:462:5: 
460. {
461.     const enum AVPixelFormat srcFormat = c->srcFormat;
462.     const enum AVPixelFormat dstFormat = c->dstFormat;
         ^
463.     const int srcId = c->srcFormatBpp;
464.     const int dstId = c->dstFormatBpp;

libswscale/swscale_unscaled.c:463:5: 
461.     const enum AVPixelFormat srcFormat = c->srcFormat;
462.     const enum AVPixelFormat dstFormat = c->dstFormat;
463.     const int srcId = c->srcFormatBpp;
         ^
464.     const int dstId = c->dstFormatBpp;
465.     rgbConvFn conv = NULL;

libswscale/swscale_unscaled.c:464:5: 
462.     const enum AVPixelFormat dstFormat = c->dstFormat;
463.     const int srcId = c->srcFormatBpp;
464.     const int dstId = c->dstFormatBpp;
         ^
465.     rgbConvFn conv = NULL;
466.     const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);

libswscale/swscale_unscaled.c:465:5: 
463.     const int srcId = c->srcFormatBpp;
464.     const int dstId = c->dstFormatBpp;
465.     rgbConvFn conv = NULL;
         ^
466.     const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);
467.     const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);

libswscale/swscale_unscaled.c:466:5: 
464.     const int dstId = c->dstFormatBpp;
465.     rgbConvFn conv = NULL;
466.     const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);
         ^
467.     const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);
468. 

libavutil/pixdesc.c:1199:1: start of procedure av_pix_fmt_desc_get()
  1197. }
  1198. 
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1201:9: Taking false branch
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1201:24: Taking true branch
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1202:9: 
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1202.         return NULL;
                ^
  1203.     return &av_pix_fmt_descriptors[pix_fmt];
  1204. }

libavutil/pixdesc.c:1204:1: return from a call to av_pix_fmt_desc_get
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];
  1204. }
        ^
  1205. 
  1206. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libswscale/swscale_unscaled.c:467:5: 
465.     rgbConvFn conv = NULL;
466.     const AVPixFmtDescriptor *desc_src = av_pix_fmt_desc_get(srcFormat);
467.     const AVPixFmtDescriptor *desc_dst = av_pix_fmt_desc_get(dstFormat);
         ^
468. 
469. #define IS_NOT_NE(bpp, desc) \

libavutil/pixdesc.c:1199:1: start of procedure av_pix_fmt_desc_get()
  1197. }
  1198. 
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1201:9: Taking false branch
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1201:24: Taking false branch
  1199. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1200. {
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1203:5: 
  1201.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];
            ^
  1204. }
  1205. 

libavutil/pixdesc.c:1204:1: return from a call to av_pix_fmt_desc_get
  1202.         return NULL;
  1203.     return &av_pix_fmt_descriptors[pix_fmt];
  1204. }
        ^
  1205. 
  1206. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libswscale/swscale_unscaled.c:474:9: Taking true branch
472. 
473.     /* if this is non-native rgb444/555/565, don't handle it here. */
474.     if (IS_NOT_NE(srcId, desc_src) || IS_NOT_NE(dstId, desc_dst))
             ^
475.         return NULL;
476. 

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 & PIX_FMT_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 & PIX_FMT_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}']