libavcodec/dvbsubdec.c:1286: error: Null Dereference
  pointer `sub->rects` last assigned on line 1269 could be null and is dereferenced at line 1286, column 16.

libavcodec/dvbsubdec.c:1257:1: start of procedure dvbsub_display_end_segment()
1255. #endif
1256. 
1257. static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
      ^
1258.                                         int buf_size, AVSubtitle *sub)
1259. {

libavcodec/dvbsubdec.c:1260:5: 
1258.                                         int buf_size, AVSubtitle *sub)
1259. {
1260.     DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
          ^
1261. 
1262.     DVBSubRegion *region;

libavcodec/dvbsubdec.c:1269:5: 
1267.     int i;
1268. 
1269.     sub->rects = NULL;
          ^
1270.     sub->start_display_time = 0;
1271.     sub->end_display_time = ctx->time_out * 1000;

libavcodec/dvbsubdec.c:1270:5: 
1268. 
1269.     sub->rects = NULL;
1270.     sub->start_display_time = 0;
          ^
1271.     sub->end_display_time = ctx->time_out * 1000;
1272.     sub->format = 0;

libavcodec/dvbsubdec.c:1271:5: 
1269.     sub->rects = NULL;
1270.     sub->start_display_time = 0;
1271.     sub->end_display_time = ctx->time_out * 1000;
          ^
1272.     sub->format = 0;
1273. 

libavcodec/dvbsubdec.c:1272:5: 
1270.     sub->start_display_time = 0;
1271.     sub->end_display_time = ctx->time_out * 1000;
1272.     sub->format = 0;
          ^
1273. 
1274.     sub->num_rects = ctx->display_list_size;

libavcodec/dvbsubdec.c:1274:5: 
1272.     sub->format = 0;
1273. 
1274.     sub->num_rects = ctx->display_list_size;
          ^
1275. 
1276.     if (sub->num_rects > 0){

libavcodec/dvbsubdec.c:1276:9: Taking false branch
1274.     sub->num_rects = ctx->display_list_size;
1275. 
1276.     if (sub->num_rects > 0){
              ^
1277.         sub->rects = av_mallocz(sizeof(*sub->rects) * sub->num_rects);
1278.         for(i=0; i<sub->num_rects; i++)

libavcodec/dvbsubdec.c:1282:5: 
1280.     }
1281. 
1282.     i = 0;
          ^
1283. 
1284.     for (display = ctx->display_list; display; display = display->next) {

libavcodec/dvbsubdec.c:1284:10: 
1282.     i = 0;
1283. 
1284.     for (display = ctx->display_list; display; display = display->next) {
               ^
1285.         region = get_region(ctx, display->region_id);
1286.         rect = sub->rects[i];

libavcodec/dvbsubdec.c:1284:39: Loop condition is true. Entering loop body
1282.     i = 0;
1283. 
1284.     for (display = ctx->display_list; display; display = display->next) {
                                            ^
1285.         region = get_region(ctx, display->region_id);
1286.         rect = sub->rects[i];

libavcodec/dvbsubdec.c:1285:9: 
1283. 
1284.     for (display = ctx->display_list; display; display = display->next) {
1285.         region = get_region(ctx, display->region_id);
              ^
1286.         rect = sub->rects[i];
1287. 

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 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 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:1286:9: 
1284.     for (display = ctx->display_list; display; display = display->next) {
1285.         region = get_region(ctx, display->region_id);
1286.         rect = sub->rects[i];
              ^
1287. 
1288.         if (!region)
