libavcodec/dvbsubdec.c:932: error: Null Dereference
  pointer `clut` last assigned on line 930 could be null and is dereferenced by call to `memcpy()` at line 932, column 9.

libavcodec/dvbsubdec.c:901:1: start of procedure dvbsub_parse_clut_segment()
899. }
900. 
901. static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
     ^
902.                                         const uint8_t *buf, int buf_size)
903. {

libavcodec/dvbsubdec.c:904:5: 
902.                                         const uint8_t *buf, int buf_size)
903. {
904.     DVBSubContext *ctx = avctx->priv_data;
         ^
905. 
906.     const uint8_t *buf_end = buf + buf_size;

libavcodec/dvbsubdec.c:906:5: 
904.     DVBSubContext *ctx = avctx->priv_data;
905. 
906.     const uint8_t *buf_end = buf + buf_size;
         ^
907.     int i, clut_id;
908.     DVBSubCLUT *clut;

libavcodec/dvbsubdec.c:915:10: 
913.     av_dlog(avctx, "DVB clut packet:\n");
914. 
915.     for (i=0; i < buf_size; i++) {
              ^
916.         av_dlog(avctx, "%02x ", buf[i]);
917.         if (i % 16 == 15)

libavcodec/dvbsubdec.c:915:15: Loop condition is false. Leaving loop
913.     av_dlog(avctx, "DVB clut packet:\n");
914. 
915.     for (i=0; i < buf_size; i++) {
                   ^
916.         av_dlog(avctx, "%02x ", buf[i]);
917.         if (i % 16 == 15)

libavcodec/dvbsubdec.c:921:9: Taking false branch
919.     }
920. 
921.     if (i % 16)
             ^
922.         av_dlog(avctx, "\n");
923. 

libavcodec/dvbsubdec.c:924:5: 
922.         av_dlog(avctx, "\n");
923. 
924.     clut_id = *buf++;
         ^
925.     buf += 1;
926. 

libavcodec/dvbsubdec.c:925:5: 
923. 
924.     clut_id = *buf++;
925.     buf += 1;
         ^
926. 
927.     clut = get_clut(ctx, clut_id);

libavcodec/dvbsubdec.c:927:5: 
925.     buf += 1;
926. 
927.     clut = get_clut(ctx, clut_id);
         ^
928. 
929.     if (!clut) {

libavcodec/dvbsubdec.c:251:1: start of procedure get_clut()
  249. }
  250. 
  251. static DVBSubCLUT* get_clut(DVBSubContext *ctx, int clut_id)
       ^
  252. {
  253.     DVBSubCLUT *ptr = ctx->clut_list;

libavcodec/dvbsubdec.c:253:5: 
  251. static DVBSubCLUT* get_clut(DVBSubContext *ctx, int clut_id)
  252. {
  253.     DVBSubCLUT *ptr = ctx->clut_list;
           ^
  254. 
  255.     while (ptr && ptr->id != clut_id) {

libavcodec/dvbsubdec.c:255:12: Loop condition is true. Entering loop body
  253.     DVBSubCLUT *ptr = ctx->clut_list;
  254. 
  255.     while (ptr && ptr->id != clut_id) {
                  ^
  256.         ptr = ptr->next;
  257.     }

libavcodec/dvbsubdec.c:255:19: Loop condition is true. Entering loop body
  253.     DVBSubCLUT *ptr = ctx->clut_list;
  254. 
  255.     while (ptr && ptr->id != clut_id) {
                         ^
  256.         ptr = ptr->next;
  257.     }

libavcodec/dvbsubdec.c:256:9: 
  254. 
  255.     while (ptr && ptr->id != clut_id) {
  256.         ptr = ptr->next;
               ^
  257.     }
  258. 

libavcodec/dvbsubdec.c:255:12: Loop condition is true. Entering loop body
  253.     DVBSubCLUT *ptr = ctx->clut_list;
  254. 
  255.     while (ptr && ptr->id != clut_id) {
                  ^
  256.         ptr = ptr->next;
  257.     }

libavcodec/dvbsubdec.c:255:19: Loop condition is true. Entering loop body
  253.     DVBSubCLUT *ptr = ctx->clut_list;
  254. 
  255.     while (ptr && ptr->id != clut_id) {
                         ^
  256.         ptr = ptr->next;
  257.     }

libavcodec/dvbsubdec.c:256:9: 
  254. 
  255.     while (ptr && ptr->id != clut_id) {
  256.         ptr = ptr->next;
               ^
  257.     }
  258. 

libavcodec/dvbsubdec.c:255:12: Loop condition is false. Leaving loop
  253.     DVBSubCLUT *ptr = ctx->clut_list;
  254. 
  255.     while (ptr && ptr->id != clut_id) {
                  ^
  256.         ptr = ptr->next;
  257.     }

libavcodec/dvbsubdec.c:259:5: 
  257.     }
  258. 
  259.     return ptr;
           ^
  260. }
  261. 

libavcodec/dvbsubdec.c:260:1: return from a call to get_clut
  258. 
  259.     return ptr;
  260. }
       ^
  261. 
  262. static DVBSubRegion* get_region(DVBSubContext *ctx, int region_id)

libavcodec/dvbsubdec.c:929:10: Taking true branch
927.     clut = get_clut(ctx, clut_id);
928. 
929.     if (!clut) {
              ^
930.         clut = av_malloc(sizeof(DVBSubCLUT));
931. 

libavcodec/dvbsubdec.c:930:9: 
928. 
929.     if (!clut) {
930.         clut = av_malloc(sizeof(DVBSubCLUT));
             ^
931. 
932.         memcpy(clut, &default_clut, sizeof(DVBSubCLUT));

libavutil/mem.c:61:1: start of procedure av_malloc()
  59.  * linker will do it automatically. */
  60. 
  61. void *av_malloc(size_t size)
      ^
  62. {
  63.     void *ptr = NULL;

libavutil/mem.c:63:5: 
  61. void *av_malloc(size_t size)
  62. {
  63.     void *ptr = NULL;
          ^
  64. #if CONFIG_MEMALIGN_HACK
  65.     long diff;

libavutil/mem.c:69:9: Taking false branch
  67. 
  68.     /* let's disallow possibly ambiguous cases */
  69.     if (size > (INT_MAX - 32) || !size)
              ^
  70.         return NULL;
  71. 

libavutil/mem.c:69:35: Taking false branch
  67. 
  68.     /* let's disallow possibly ambiguous cases */
  69.     if (size > (INT_MAX - 32) || !size)
                                        ^
  70.         return NULL;
  71. 

libavutil/mem.c:80:9: Taking true branch
  78.     ((char *)ptr)[-1] = diff;
  79. #elif HAVE_POSIX_MEMALIGN
  80.     if (posix_memalign(&ptr, 32, size))
              ^
  81.         ptr = NULL;
  82. #elif HAVE_ALIGNED_MALLOC

libavutil/mem.c:81:9: 
  79. #elif HAVE_POSIX_MEMALIGN
  80.     if (posix_memalign(&ptr, 32, size))
  81.         ptr = NULL;
              ^
  82. #elif HAVE_ALIGNED_MALLOC
  83.     ptr = _aligned_malloc(size, 32);

libavutil/mem.c:113:5: 
  111.     ptr = malloc(size);
  112. #endif
  113.     return ptr;
           ^
  114. }
  115. 

libavutil/mem.c:114:1: return from a call to av_malloc
  112. #endif
  113.     return ptr;
  114. }
       ^
  115. 
  116. void *av_realloc(void *ptr, size_t size)

libavcodec/dvbsubdec.c:932:9: 
930.         clut = av_malloc(sizeof(DVBSubCLUT));
931. 
932.         memcpy(clut, &default_clut, sizeof(DVBSubCLUT));
             ^
933. 
934.         clut->id = clut_id;
