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

libavcodec/mpegvideo.c:1646:1: start of procedure ff_MPV_frame_end()
1644. 
1645. /* called after a frame has been decoded. */
1646. void ff_MPV_frame_end(MpegEncContext *s)
      ^
1647. {
1648. #if FF_API_XVMC

libavcodec/mpegvideo.c:1652:9: Taking false branch
1650.     /* redraw edges for the frame if decoding didn't complete */
1651.     // just to make sure that all data is rendered.
1652.     if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) {
              ^
1653.         ff_xvmc_field_end(s);
1654.     } else

libavcodec/mpegvideo.c:1657:9: Taking true branch
1655. FF_ENABLE_DEPRECATION_WARNINGS
1656. #endif /* FF_API_XVMC */
1657.     if (s->er.error_count  &&
              ^
1658.         !s->avctx->hwaccel &&
1659.         s->unrestricted_mv &&

libavcodec/mpegvideo.c:1658:10: Taking true branch
1656. #endif /* FF_API_XVMC */
1657.     if (s->er.error_count  &&
1658.         !s->avctx->hwaccel &&
               ^
1659.         s->unrestricted_mv &&
1660.         s->current_picture.reference &&

libavcodec/mpegvideo.c:1659:9: Taking true branch
1657.     if (s->er.error_count  &&
1658.         !s->avctx->hwaccel &&
1659.         s->unrestricted_mv &&
              ^
1660.         s->current_picture.reference &&
1661.         !s->intra_only &&

libavcodec/mpegvideo.c:1660:9: Taking true branch
1658.         !s->avctx->hwaccel &&
1659.         s->unrestricted_mv &&
1660.         s->current_picture.reference &&
              ^
1661.         !s->intra_only &&
1662.         !(s->flags & CODEC_FLAG_EMU_EDGE)) {

libavcodec/mpegvideo.c:1661:10: Taking true branch
1659.         s->unrestricted_mv &&
1660.         s->current_picture.reference &&
1661.         !s->intra_only &&
               ^
1662.         !(s->flags & CODEC_FLAG_EMU_EDGE)) {
1663.         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);

libavcodec/mpegvideo.c:1662:11: Taking true branch
1660.         s->current_picture.reference &&
1661.         !s->intra_only &&
1662.         !(s->flags & CODEC_FLAG_EMU_EDGE)) {
                ^
1663.         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
1664.         int hshift = desc->log2_chroma_w;

libavcodec/mpegvideo.c:1663:9: 
1661.         !s->intra_only &&
1662.         !(s->flags & CODEC_FLAG_EMU_EDGE)) {
1663.         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
              ^
1664.         int hshift = desc->log2_chroma_w;
1665.         int vshift = desc->log2_chroma_h;

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)

libavcodec/mpegvideo.c:1664:9: 
1662.         !(s->flags & CODEC_FLAG_EMU_EDGE)) {
1663.         const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->avctx->pix_fmt);
1664.         int hshift = desc->log2_chroma_w;
              ^
1665.         int vshift = desc->log2_chroma_h;
1666.         s->dsp.draw_edges(s->current_picture.f.data[0], s->linesize,

void ff_MPV_frame_end(MpegEncContext *s)
{
#if FF_API_XVMC
FF_DISABLE_DEPRECATION_WARNINGS
    if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) {
        ff_xvmc_field_end(s);
    } else
FF_ENABLE_DEPRECATION_WARNINGS
#endif
    if (s->er.error_count  &&
        !s->avctx->hwaccel &&
        s->unrestricted_mv &&
        s->current_picture.reference &&
        !s->intra_only &&
        !(s->flags & CODEC_FLAG_EMU_EDGE)) {
        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->dsp.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->dsp.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->dsp.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();
    if (s->current_picture.reference)
        ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0);
}
['void ff_MPV_frame_end(MpegEncContext *s)\n{\n#if FF_API_XVMC\nFF_DISABLE_DEPRECATION_WARNINGS\n    if (CONFIG_MPEG_XVMC_DECODER && s->avctx->xvmc_acceleration) {\n        ff_xvmc_field_end(s);\n    } else\nFF_ENABLE_DEPRECATION_WARNINGS\n#endif\n    if (s->er.error_count  &&\n        !s->avctx->hwaccel &&\n        s->unrestricted_mv &&\n        s->current_picture.reference &&\n        !s->intra_only &&\n        !(s->flags & CODEC_FLAG_EMU_EDGE)) {\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->dsp.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->dsp.draw_edges(s->current_picture.f.data[1], s->uvlinesize,\n                          s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,\n                          EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,\n                          EDGE_TOP | EDGE_BOTTOM);\n        s->dsp.draw_edges(s->current_picture.f.data[2], s->uvlinesize,\n                          s->h_edge_pos >> hshift, s->v_edge_pos >> vshift,\n                          EDGE_WIDTH >> hshift, EDGE_WIDTH >> vshift,\n                          EDGE_TOP | EDGE_BOTTOM);\n    }\n    emms_c();\n    if (s->current_picture.reference)\n        ff_thread_report_progress(&s->current_picture_ptr->tf, INT_MAX, 0);\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}']