]> git.sesse.net Git - vlc/commitdiff
zvbi: do not copy object of several kilo-bytes on the stack
authorRémi Denis-Courmont <remi@remlab.net>
Tue, 22 Apr 2014 21:14:49 +0000 (00:14 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Tue, 22 Apr 2014 21:15:13 +0000 (00:15 +0300)
modules/codec/zvbi.c

index 6174e0375f953e7643701a3bd5ac395382177407..bd5599fb04b6f8d688316ddad347c7b16e021a2d 100644 (file)
@@ -168,7 +168,7 @@ static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
                                  int i_align, mtime_t i_pts );
 
 static void EventHandler( vbi_event *ev, void *user_data );
-static int OpaquePage( picture_t *p_src, const vbi_page p_page,
+static int OpaquePage( picture_t *p_src, const vbi_page *p_page,
                        const video_format_t fmt, bool b_opaque, const int text_offset );
 static int get_first_visible_row( vbi_char *p_text, int rows, int columns);
 static int get_last_visible_row( vbi_char *p_text, int rows, int columns);
@@ -469,7 +469,7 @@ static subpicture_t *Decode( decoder_t *p_dec, block_t **pp_block )
         memcpy( p_sys->nav_link, &p_page.nav_link, sizeof( p_sys->nav_link )) ;
         vlc_mutex_unlock( &p_sys->lock );
 
-        OpaquePage( p_pic, p_page, fmt, b_opaque, i_first_row * p_page.columns );
+        OpaquePage( p_pic, &p_page, fmt, b_opaque, i_first_row * p_page.columns );
     }
 
 exit:
@@ -618,7 +618,7 @@ static int get_last_visible_row( vbi_char *p_text, int rows, int columns)
     return -1;
 }
 
-static int OpaquePage( picture_t *p_src, const vbi_page p_page,
+static int OpaquePage( picture_t *p_src, const vbi_page *p_page,
                        const video_format_t fmt, bool b_opaque, const int text_offset )
 {
     unsigned int    x, y;
@@ -630,8 +630,8 @@ static int OpaquePage( picture_t *p_src, const vbi_page p_page,
     {
         for( x = 0; x < fmt.i_width; x++ )
         {
-            const vbi_opacity opacity = p_page.text[ text_offset + y/10 * p_page.columns + x/12 ].opacity;
-            const int background = p_page.text[ text_offset + y/10 * p_page.columns + x/12 ].background;
+            const vbi_opacity opacity = p_page->text[ text_offset + y/10 * p_page->columns + x/12 ].opacity;
+            const int background = p_page->text[ text_offset + y/10 * p_page->columns + x/12 ].background;
             uint32_t *p_pixel = (uint32_t*)&p_src->p->p_pixels[y * p_src->p->i_pitch + 4*x];
 
             switch( opacity )
@@ -651,7 +651,7 @@ static int OpaquePage( picture_t *p_src, const vbi_page p_page,
                     break;
             /* Full text transparency. only foreground color is show */
             case VBI_TRANSPARENT_FULL:
-                if( (*p_pixel) == (0xff000000 | p_page.color_map[background] ) )
+                if( (*p_pixel) == (0xff000000 | p_page->color_map[background] ) )
                     *p_pixel = 0;
                 break;
             }