libavcodec/mpegvideo_enc.c:1397: error: Null Dereference
  pointer `desc` last assigned on line 1396 could be null and is dereferenced at line 1397, column 22.

libavcodec/mpegvideo_enc.c:1389:1: start of procedure frame_end()
1387. }
1388. 
1389. static void frame_end(MpegEncContext *s)
      ^
1390. {
1391.     int i;

libavcodec/mpegvideo_enc.c:1393:9: Taking true branch
1391.     int i;
1392. 
1393.     if (s->unrestricted_mv &&
              ^
1394.         s->current_picture.reference &&
1395.         !s->intra_only) {

libavcodec/mpegvideo_enc.c:1394:9: Taking true branch
1392. 
1393.     if (s->unrestricted_mv &&
1394.         s->current_picture.reference &&
              ^
1395.         !s->intra_only) {
1396.         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);

libavcodec/mpegvideo_enc.c:1395:10: Taking true branch
1393.     if (s->unrestricted_mv &&
1394.         s->current_picture.reference &&
1395.         !s->intra_only) {
               ^
1396.         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
1397.         int hshift = desc->log2_chroma_w;

libavcodec/mpegvideo_enc.c:1396:9: 
1394.         s->current_picture.reference &&
1395.         !s->intra_only) {
1396.         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
              ^
1397.         int hshift = desc->log2_chroma_w;
1398.         int vshift = desc->log2_chroma_h;

libavutil/pixdesc.c:1574:1: start of procedure av_pix_fmt_desc_get()
  1572. }
  1573. 
  1574. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
        ^
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)

libavutil/pixdesc.c:1576:9: Taking false branch
  1574. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                ^
  1577.         return NULL;
  1578.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1576:24: Taking true branch
  1574. const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
                               ^
  1577.         return NULL;
  1578.     return &av_pix_fmt_descriptors[pix_fmt];

libavutil/pixdesc.c:1577:9: 
  1575. {
  1576.     if (pix_fmt < 0 || pix_fmt >= AV_PIX_FMT_NB)
  1577.         return NULL;
                ^
  1578.     return &av_pix_fmt_descriptors[pix_fmt];
  1579. }

libavutil/pixdesc.c:1579:1: return from a call to av_pix_fmt_desc_get
  1577.         return NULL;
  1578.     return &av_pix_fmt_descriptors[pix_fmt];
  1579. }
        ^
  1580. 
  1581. const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev)

libavcodec/mpegvideo_enc.c:1397:9: 
1395.         !s->intra_only) {
1396.         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
1397.         int hshift = desc->log2_chroma_w;
              ^
1398.         int vshift = desc->log2_chroma_h;
1399.         s->mpvencdsp.draw_edges(s->current_picture.f->data[0], s->linesize,

static void frame_end(MpegEncContext *s)
{
    int i;
    if (s->unrestricted_mv &&
        s->current_picture.reference &&
        !s->intra_only) {
        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
        int hshift = desc->log2_chroma_w;
        int vshift = desc->log2_chroma_h;
        s->mpvencdsp.draw_edges(s->current_picture.f->data[0], s->linesize,
                                s->h_edge_pos, s->v_edge_pos,
                                EDGE_WIDTH, EDGE_WIDTH,
                                EDGE_TOP | EDGE_BOTTOM);
        s->mpvencdsp.draw_edges(s->current_picture.f->data[1], s->uvlinesize,
                                s->h_edge_pos >> hshift,
                                s->v_edge_pos >> vshift,
                                EDGE_WIDTH >> hshift,
                                EDGE_WIDTH >> vshift,
                                EDGE_TOP | EDGE_BOTTOM);
        s->mpvencdsp.draw_edges(s->current_picture.f->data[2], s->uvlinesize,
                                s->h_edge_pos >> hshift,
                                s->v_edge_pos >> vshift,
                                EDGE_WIDTH >> hshift,
                                EDGE_WIDTH >> vshift,
                                EDGE_TOP | EDGE_BOTTOM);
    }
    emms_c();
    s->last_pict_type                 = s->pict_type;
    s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f->quality;
    if (s->pict_type!= AV_PICTURE_TYPE_B)
        s->last_non_b_pict_type = s->pict_type;
    if (s->encoding) {
        for (i = 0; i < MAX_PICTURE_COUNT; i++) {
            if (!s->picture[i].reference)
                ff_mpeg_unref_picture(s, &s->picture[i]);
        }
    }
    s->avctx->coded_frame = s->current_picture_ptr->f;
}
['static void frame_end(MpegEncContext *s)\n{\n    int i;\n    if (s->unrestricted_mv &&\n        s->current_picture.reference &&\n        !s->intra_only) {\n        const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);\n        int hshift = desc->log2_chroma_w;\n        int vshift = desc->log2_chroma_h;\n        s->mpvencdsp.draw_edges(s->current_picture.f->data[0], s->linesize,\n                                s->h_edge_pos, s->v_edge_pos,\n                                EDGE_WIDTH, EDGE_WIDTH,\n                                EDGE_TOP | EDGE_BOTTOM);\n        s->mpvencdsp.draw_edges(s->current_picture.f->data[1], s->uvlinesize,\n                                s->h_edge_pos >> hshift,\n                                s->v_edge_pos >> vshift,\n                                EDGE_WIDTH >> hshift,\n                                EDGE_WIDTH >> vshift,\n                                EDGE_TOP | EDGE_BOTTOM);\n        s->mpvencdsp.draw_edges(s->current_picture.f->data[2], s->uvlinesize,\n                                s->h_edge_pos >> hshift,\n                                s->v_edge_pos >> vshift,\n                                EDGE_WIDTH >> hshift,\n                                EDGE_WIDTH >> vshift,\n                                EDGE_TOP | EDGE_BOTTOM);\n    }\n    emms_c();\n    s->last_pict_type                 = s->pict_type;\n    s->last_lambda_for [s->pict_type] = s->current_picture_ptr->f->quality;\n    if (s->pict_type!= AV_PICTURE_TYPE_B)\n        s->last_non_b_pict_type = s->pict_type;\n    if (s->encoding) {\n        for (i = 0; i < MAX_PICTURE_COUNT; i++) {\n            if (!s->picture[i].reference)\n                ff_mpeg_unref_picture(s, &s->picture[i]);\n        }\n    }\n    s->avctx->coded_frame = s->current_picture_ptr->f;\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}']