diff dvbsubdec.c @ 8512:aa45029f5cd7 libavcodec

Change AVSubtitle.rects to an array of pointers so ABI does not break when the size of AVSubtitleRect changes.
author michael
date Sat, 03 Jan 2009 17:54:48 +0000
parents e943e1409077
children 315b302fcd1d
line wrap: on
line diff
--- a/dvbsubdec.c	Sat Jan 03 15:15:03 2009 +0000
+++ b/dvbsubdec.c	Sat Jan 03 17:54:48 2009 +0000
@@ -1285,14 +1285,17 @@
 
     sub->num_rects = ctx->display_list_size;
 
-    if (sub->num_rects > 0)
-        sub->rects = av_mallocz(sizeof(AVSubtitleRect) * sub->num_rects);
+    if (sub->num_rects > 0){
+        sub->rects = av_mallocz(sizeof(*sub->rects) * sub->num_rects);
+        for(i=0; i<sub->num_rects; i++)
+            sub->rects[i] = av_mallocz(sizeof(*sub->rects[i]));
+    }
 
     i = 0;
 
     for (display = ctx->display_list; display; display = display->next) {
         region = get_region(ctx, display->region_id);
-        rect = &sub->rects[i];
+        rect = sub->rects[i];
 
         if (!region)
             continue;