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

libavcodec/dvbsubdec.c:893:1: start of procedure dvbsub_parse_clut_segment()
891. }
892. 
893. static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
     ^
894.                                         const uint8_t *buf, int buf_size)
895. {

libavcodec/dvbsubdec.c:896:5: 
894.                                         const uint8_t *buf, int buf_size)
895. {
896.     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
         ^
897. 
898.     const uint8_t *buf_end = buf + buf_size;

libavcodec/dvbsubdec.c:898:5: 
896.     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
897. 
898.     const uint8_t *buf_end = buf + buf_size;
         ^
899.     int clut_id;
900.     DVBSubCLUT *clut;

libavcodec/dvbsubdec.c:921:5: 
919. #endif
920. 
921.     clut_id = *buf++;
         ^
922.     buf += 1;
923. 

libavcodec/dvbsubdec.c:922:5: 
920. 
921.     clut_id = *buf++;
922.     buf += 1;
         ^
923. 
924.     clut = get_clut(ctx, clut_id);

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

libavcodec/dvbsubdec.c:244:1: start of procedure get_clut()
  242. }
  243. 
  244. static DVBSubCLUT* get_clut(DVBSubContext *ctx, int clut_id)
       ^
  245. {
  246.     DVBSubCLUT *ptr = ctx->clut_list;

libavcodec/dvbsubdec.c:246:5: 
  244. static DVBSubCLUT* get_clut(DVBSubContext *ctx, int clut_id)
  245. {
  246.     DVBSubCLUT *ptr = ctx->clut_list;
           ^
  247. 
  248.     while (ptr && ptr->id != clut_id) {

libavcodec/dvbsubdec.c:248:12: Loop condition is true. Entering loop body
  246.     DVBSubCLUT *ptr = ctx->clut_list;
  247. 
  248.     while (ptr && ptr->id != clut_id) {
                  ^
  249.         ptr = ptr->next;
  250.     }

libavcodec/dvbsubdec.c:248:19: Loop condition is true. Entering loop body
  246.     DVBSubCLUT *ptr = ctx->clut_list;
  247. 
  248.     while (ptr && ptr->id != clut_id) {
                         ^
  249.         ptr = ptr->next;
  250.     }

libavcodec/dvbsubdec.c:249:9: 
  247. 
  248.     while (ptr && ptr->id != clut_id) {
  249.         ptr = ptr->next;
               ^
  250.     }
  251. 

libavcodec/dvbsubdec.c:248:12: Loop condition is true. Entering loop body
  246.     DVBSubCLUT *ptr = ctx->clut_list;
  247. 
  248.     while (ptr && ptr->id != clut_id) {
                  ^
  249.         ptr = ptr->next;
  250.     }

libavcodec/dvbsubdec.c:248:19: Loop condition is true. Entering loop body
  246.     DVBSubCLUT *ptr = ctx->clut_list;
  247. 
  248.     while (ptr && ptr->id != clut_id) {
                         ^
  249.         ptr = ptr->next;
  250.     }

libavcodec/dvbsubdec.c:249:9: 
  247. 
  248.     while (ptr && ptr->id != clut_id) {
  249.         ptr = ptr->next;
               ^
  250.     }
  251. 

libavcodec/dvbsubdec.c:248:12: Loop condition is false. Leaving loop
  246.     DVBSubCLUT *ptr = ctx->clut_list;
  247. 
  248.     while (ptr && ptr->id != clut_id) {
                  ^
  249.         ptr = ptr->next;
  250.     }

libavcodec/dvbsubdec.c:252:5: 
  250.     }
  251. 
  252.     return ptr;
           ^
  253. }
  254. 

libavcodec/dvbsubdec.c:253:1: return from a call to get_clut
  251. 
  252.     return ptr;
  253. }
       ^
  254. 
  255. static DVBSubRegion* get_region(DVBSubContext *ctx, int region_id)

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

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

libavutil/mem.c:47:1: start of procedure av_malloc()
  45.    linker will do it automatically. */
  46. 
  47. void *av_malloc(unsigned int size)
      ^
  48. {
  49.     void *ptr = NULL;

libavutil/mem.c:49:5: 
  47. void *av_malloc(unsigned int size)
  48. {
  49.     void *ptr = NULL;
          ^
  50. #if CONFIG_MEMALIGN_HACK
  51.     long diff;

libavutil/mem.c:55:8: Taking false branch
  53. 
  54.     /* let's disallow possible ambiguous cases */
  55.     if(size > (INT_MAX-16) )
             ^
  56.         return NULL;
  57. 

libavutil/mem.c:66:9: Taking true branch
  64.     ((char*)ptr)[-1]= diff;
  65. #elif HAVE_POSIX_MEMALIGN
  66.     if (posix_memalign(&ptr,16,size))
              ^
  67.         ptr = NULL;
  68. #elif HAVE_MEMALIGN

libavutil/mem.c:67:9: 
  65. #elif HAVE_POSIX_MEMALIGN
  66.     if (posix_memalign(&ptr,16,size))
  67.         ptr = NULL;
              ^
  68. #elif HAVE_MEMALIGN
  69.     ptr = memalign(16,size);

libavutil/mem.c:99:5: 
   97.     ptr = malloc(size);
   98. #endif
   99.     return ptr;
           ^
  100. }
  101. 

libavutil/mem.c:100:1: return from a call to av_malloc
   98. #endif
   99.     return ptr;
  100. }
       ^
  101. 
  102. void *av_realloc(void *ptr, unsigned int size)

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