libavcodec/dvbsubdec.c:1007: error: Null Dereference
  pointer `region` last assigned on line 1005 could be null and is dereferenced at line 1007, column 9.

libavcodec/dvbsubdec.c:985:1: start of procedure dvbsub_parse_region_segment()
983. 
984. 
985. static void dvbsub_parse_region_segment(AVCodecContext *avctx,
     ^
986.                                         const uint8_t *buf, int buf_size)
987. {

libavcodec/dvbsubdec.c:988:5: 
986.                                         const uint8_t *buf, int buf_size)
987. {
988.     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
         ^
989. 
990.     const uint8_t *buf_end = buf + buf_size;

libavcodec/dvbsubdec.c:990:5: 
988.     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
989. 
990.     const uint8_t *buf_end = buf + buf_size;
         ^
991.     int region_id, object_id;
992.     DVBSubRegion *region;

libavcodec/dvbsubdec.c:997:9: Taking false branch
995.     int fill;
996. 
997.     if (buf_size < 10)
             ^
998.         return;
999. 

libavcodec/dvbsubdec.c:1000:5: 
 998.         return;
 999. 
1000.     region_id = *buf++;
          ^
1001. 
1002.     region = get_region(ctx, region_id);

libavcodec/dvbsubdec.c:1002:5: 
1000.     region_id = *buf++;
1001. 
1002.     region = get_region(ctx, region_id);
          ^
1003. 
1004.     if (!region) {

libavcodec/dvbsubdec.c:255:1: start of procedure get_region()
  253. }
  254. 
  255. static DVBSubRegion* get_region(DVBSubContext *ctx, int region_id)
       ^
  256. {
  257.     DVBSubRegion *ptr = ctx->region_list;

libavcodec/dvbsubdec.c:257:5: 
  255. static DVBSubRegion* get_region(DVBSubContext *ctx, int region_id)
  256. {
  257.     DVBSubRegion *ptr = ctx->region_list;
           ^
  258. 
  259.     while (ptr && ptr->id != region_id) {

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

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

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

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

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

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

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

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

libavcodec/dvbsubdec.c:264:1: return from a call to get_region
  262. 
  263.     return ptr;
  264. }
       ^
  265. 
  266. static void delete_region_display_list(DVBSubContext *ctx, DVBSubRegion *region)

libavcodec/dvbsubdec.c:1004:10: Taking true branch
1002.     region = get_region(ctx, region_id);
1003. 
1004.     if (!region) {
               ^
1005.         region = av_mallocz(sizeof(DVBSubRegion));
1006. 

libavcodec/dvbsubdec.c:1005:9: 
1003. 
1004.     if (!region) {
1005.         region = av_mallocz(sizeof(DVBSubRegion));
              ^
1006. 
1007.         region->id = region_id;

libavutil/mem.c:132:1: start of procedure av_mallocz()
  130. }
  131. 
  132. void *av_mallocz(unsigned int size)
       ^
  133. {
  134.     void *ptr = av_malloc(size);

libavutil/mem.c:134:5: 
  132. void *av_mallocz(unsigned int size)
  133. {
  134.     void *ptr = av_malloc(size);
           ^
  135.     if (ptr)
  136.         memset(ptr, 0, size);

libavutil/mem.c:42:1: start of procedure av_malloc()
    40.    linker will do it automatically */
    41. 
    42. void *av_malloc(unsigned int size)
        ^
    43. {
    44.     void *ptr;

libavutil/mem.c:50:8: Taking false branch
    48. 
    49.     /* let's disallow possible ambiguous cases */
    50.     if(size > (INT_MAX-16) )
               ^
    51.         return NULL;
    52. 

libavutil/mem.c:61:5: Skipping memalign(): method has no implementation
    59.     ((char*)ptr)[-1]= diff;
    60. #elif defined (HAVE_MEMALIGN)
    61.     ptr = memalign(16,size);
            ^
    62.     /* Why 64?
    63.        Indeed, we should align it:

libavutil/mem.c:91:5: 
    89.     ptr = malloc(size);
    90. #endif
    91.     return ptr;
            ^
    92. }
    93. 

libavutil/mem.c:92:1: return from a call to av_malloc
    90. #endif
    91.     return ptr;
    92. }
        ^
    93. 
    94. void *av_realloc(void *ptr, unsigned int size)

libavutil/mem.c:135:9: Taking false branch
  133. {
  134.     void *ptr = av_malloc(size);
  135.     if (ptr)
               ^
  136.         memset(ptr, 0, size);
  137.     return ptr;

libavutil/mem.c:137:5: 
  135.     if (ptr)
  136.         memset(ptr, 0, size);
  137.     return ptr;
           ^
  138. }
  139. 

libavutil/mem.c:138:1: return from a call to av_mallocz
  136.         memset(ptr, 0, size);
  137.     return ptr;
  138. }
       ^
  139. 
  140. char *av_strdup(const char *s)

libavcodec/dvbsubdec.c:1007:9: 
1005.         region = av_mallocz(sizeof(DVBSubRegion));
1006. 
1007.         region->id = region_id;
              ^
1008. 
1009.         region->next = ctx->region_list;
