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

libavcodec/dvbsubdec.c:909:1: start of procedure dvbsub_parse_clut_segment()
907. }
908. 
909. static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
     ^
910.                                         const uint8_t *buf, int buf_size)
911. {

libavcodec/dvbsubdec.c:912:5: 
910.                                         const uint8_t *buf, int buf_size)
911. {
912.     DVBSubContext *ctx = avctx->priv_data;
         ^
913. 
914.     const uint8_t *buf_end = buf + buf_size;

libavcodec/dvbsubdec.c:914:5: 
912.     DVBSubContext *ctx = avctx->priv_data;
913. 
914.     const uint8_t *buf_end = buf + buf_size;
         ^
915.     int clut_id;
916.     DVBSubCLUT *clut;

libavcodec/dvbsubdec.c:937:5: 
935. #endif
936. 
937.     clut_id = *buf++;
         ^
938.     buf += 1;
939. 

libavcodec/dvbsubdec.c:938:5: 
936. 
937.     clut_id = *buf++;
938.     buf += 1;
         ^
939. 
940.     clut = get_clut(ctx, clut_id);

libavcodec/dvbsubdec.c:940:5: 
938.     buf += 1;
939. 
940.     clut = get_clut(ctx, clut_id);
         ^
941. 
942.     if (!clut) {

libavcodec/dvbsubdec.c:256:1: start of procedure get_clut()
  254. }
  255. 
  256. static DVBSubCLUT* get_clut(DVBSubContext *ctx, int clut_id)
       ^
  257. {
  258.     DVBSubCLUT *ptr = ctx->clut_list;

libavcodec/dvbsubdec.c:258:5: 
  256. static DVBSubCLUT* get_clut(DVBSubContext *ctx, int clut_id)
  257. {
  258.     DVBSubCLUT *ptr = ctx->clut_list;
           ^
  259. 
  260.     while (ptr && ptr->id != clut_id) {

libavcodec/dvbsubdec.c:260:12: Loop condition is true. Entering loop body
  258.     DVBSubCLUT *ptr = ctx->clut_list;
  259. 
  260.     while (ptr && ptr->id != clut_id) {
                  ^
  261.         ptr = ptr->next;
  262.     }

libavcodec/dvbsubdec.c:260:19: Loop condition is true. Entering loop body
  258.     DVBSubCLUT *ptr = ctx->clut_list;
  259. 
  260.     while (ptr && ptr->id != clut_id) {
                         ^
  261.         ptr = ptr->next;
  262.     }

libavcodec/dvbsubdec.c:261:9: 
  259. 
  260.     while (ptr && ptr->id != clut_id) {
  261.         ptr = ptr->next;
               ^
  262.     }
  263. 

libavcodec/dvbsubdec.c:260:12: Loop condition is true. Entering loop body
  258.     DVBSubCLUT *ptr = ctx->clut_list;
  259. 
  260.     while (ptr && ptr->id != clut_id) {
                  ^
  261.         ptr = ptr->next;
  262.     }

libavcodec/dvbsubdec.c:260:19: Loop condition is true. Entering loop body
  258.     DVBSubCLUT *ptr = ctx->clut_list;
  259. 
  260.     while (ptr && ptr->id != clut_id) {
                         ^
  261.         ptr = ptr->next;
  262.     }

libavcodec/dvbsubdec.c:261:9: 
  259. 
  260.     while (ptr && ptr->id != clut_id) {
  261.         ptr = ptr->next;
               ^
  262.     }
  263. 

libavcodec/dvbsubdec.c:260:12: Loop condition is false. Leaving loop
  258.     DVBSubCLUT *ptr = ctx->clut_list;
  259. 
  260.     while (ptr && ptr->id != clut_id) {
                  ^
  261.         ptr = ptr->next;
  262.     }

libavcodec/dvbsubdec.c:264:5: 
  262.     }
  263. 
  264.     return ptr;
           ^
  265. }
  266. 

libavcodec/dvbsubdec.c:265:1: return from a call to get_clut
  263. 
  264.     return ptr;
  265. }
       ^
  266. 
  267. static DVBSubRegion* get_region(DVBSubContext *ctx, int region_id)

libavcodec/dvbsubdec.c:942:10: Taking true branch
940.     clut = get_clut(ctx, clut_id);
941. 
942.     if (!clut) {
              ^
943.         clut = av_malloc(sizeof(DVBSubCLUT));
944. 

libavcodec/dvbsubdec.c:943:9: 
941. 
942.     if (!clut) {
943.         clut = av_malloc(sizeof(DVBSubCLUT));
             ^
944. 
945.         memcpy(clut, &default_clut, sizeof(DVBSubCLUT));

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

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

libavutil/mem.c:72:8: Taking false branch
  70. 
  71.     /* let's disallow possible ambiguous cases */
  72.     if(size > (INT_MAX-32) )
             ^
  73.         return NULL;
  74. 

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

libavutil/mem.c:84:9: 
  82. #elif HAVE_POSIX_MEMALIGN
  83.     if (posix_memalign(&ptr,32,size))
  84.         ptr = NULL;
              ^
  85. #elif HAVE_MEMALIGN
  86.     ptr = memalign(32,size);

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

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

libavcodec/dvbsubdec.c:945:9: 
943.         clut = av_malloc(sizeof(DVBSubCLUT));
944. 
945.         memcpy(clut, &default_clut, sizeof(DVBSubCLUT));
             ^
946. 
947.         clut->id = clut_id;
