Changeset f367feacc7afd5a654fc629b82f590d05fd0ea6a

Show
Ignore:
Timestamp:
05/01/01 17:12:22 (7 years ago)
Author:
Sam Hocevar <sam@videolan.org>
git-committer:
Sam Hocevar <sam@videolan.org> 988729942 +0000
git-parent:

[543556379d3748bc9e724cbbcdd4b7c100fca3dc]

git-author:
Sam Hocevar <sam@videolan.org> 988729942 +0000
Message:
  • Fixed a remaining buffer overflow in the Gnome interface and applied
    the patches to the Gtk+ interface.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ChangeLog

    r5435563 rf367fea  
    55HEAD 
    66 
     7  * Fixed a remaining buffer overflow in the Gnome interface and applied 
     8    the patches to the Gtk+ interface. 
    79  * Fixed a segfault in the SPU decoder initialization. 
    810  * Mandatory step for video output IV and the audio output quality 
  • plugins/gnome/intf_gnome.c

    ra70f8bb rf367fea  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: intf_gnome.c,v 1.34 2001/05/01 04:18:18 sam Exp $ 
     5 * $Id: intf_gnome.c,v 1.35 2001/05/01 15:12:22 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    439439                          void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) ) 
    440440{ 
    441 #define GNOME_LANGUAGE_MENU_SIZE 64 
    442441    intf_thread_t *     p_intf; 
    443442    GtkWidget *         p_menu; 
     
    446445    GtkWidget *         p_item_active; 
    447446    GSList *            p_group; 
    448     char                psz_name[ GNOME_LANGUAGE_MENU_SIZE ]; 
     447    char                psz_name[ GNOME_MENU_LABEL_SIZE ]; 
    449448    gint                i_item; 
    450449    gint                i; 
     
    465464 
    466465    /* special case for "off" item */ 
    467     snprintf( psz_name, GNOME_LANGUAGE_MENU_SIZE, "Off" ); 
    468     psz_name[ GNOME_LANGUAGE_MENU_SIZE - 1 ] = '\0'; 
     466    snprintf( psz_name, GNOME_MENU_LABEL_SIZE, "Off" ); 
     467    psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0'; 
    469468 
    470469    p_item = gtk_radio_menu_item_new_with_label( p_group, psz_name ); 
     
    497496            if( psz_name[0] == '\0' ) 
    498497            { 
    499                 snprintf( psz_name, GNOME_LANGUAGE_MENU_SIZE, 
     498                snprintf( psz_name, GNOME_MENU_LABEL_SIZE, 
    500499                          "Language %d", i_item ); 
    501                 psz_name[ GNOME_LANGUAGE_MENU_SIZE - 1 ] = '\0'; 
     500                psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0'; 
    502501            } 
    503502 
     
    551550                        void(*pf_toggle)( GtkCheckMenuItem *, gpointer ) ) 
    552551{ 
    553 #define GNOME_ANGLE_MENU_SIZE 64 
    554552    intf_thread_t *     p_intf; 
    555     char                psz_name[ GNOME_ANGLE_MENU_SIZE ]; 
     553    char                psz_name[ GNOME_MENU_LABEL_SIZE ]; 
    556554    GtkWidget *         p_angle_menu; 
    557555    GSList *            p_angle_group; 
     
    576574         i_angle++ ) 
    577575    { 
    578         snprintf( psz_name, GNOME_ANGLE_MENU_SIZE, "Angle %d", i_angle + 1 ); 
    579         psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0'; 
     576        snprintf( psz_name, GNOME_MENU_LABEL_SIZE, "Angle %d", i_angle + 1 ); 
     577        psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0'; 
    580578 
    581579        p_item = gtk_radio_menu_item_new_with_label( p_angle_group, 
     
    625623{ 
    626624    intf_thread_t *     p_intf; 
    627     char                psz_name[12]; 
     625    char                psz_name[ GNOME_MENU_LABEL_SIZE ]; 
    628626    GtkWidget *         p_chapter_menu; 
    629627    GtkWidget *         p_chapter_submenu; 
     
    636634    gint                i_nb; 
    637635 
    638     /* cast */ 
     636    /* Cast */ 
    639637    p_intf = (intf_thread_t*)p_data; 
    640638 
    641     /* removes previous menu */ 
     639    /* Removes previous menu */ 
    642640    gtk_menu_item_remove_submenu( GTK_MENU_ITEM( p_chapter ) ); 
    643641    gtk_widget_set_sensitive( p_chapter, FALSE ); 
     
    664662            } 
    665663 
    666             snprintf( psz_name, GNOME_ANGLE_MENU_SIZE, 
     664            snprintf( psz_name, GNOME_MENU_LABEL_SIZE, 
    667665                      "%d - %d", i_chapter + 1, i_chapter + 10); 
    668             psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0'; 
     666            psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0'; 
    669667            p_menu_item = gtk_menu_item_new_with_label( psz_name ); 
    670668            gtk_widget_show( p_menu_item ); 
     
    672670        } 
    673671 
    674         snprintf( psz_name, GNOME_ANGLE_MENU_SIZE, 
     672        snprintf( psz_name, GNOME_MENU_LABEL_SIZE, 
    675673                  "Chapter %d", i_chapter + 1 ); 
    676         psz_name[ GNOME_ANGLE_MENU_SIZE - 1 ] = '\0'; 
     674        psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0'; 
    677675 
    678676        p_item = gtk_radio_menu_item_new_with_label( p_chapter_group, 
     
    743741                            void(*pf_toggle )( GtkCheckMenuItem *, gpointer ) ) 
    744742{ 
    745 #define GNOME_TITLE_MENU_SIZE 64 
    746743    intf_thread_t *     p_intf; 
    747     char                psz_name[ GNOME_TITLE_MENU_SIZE ]; 
     744    char                psz_name[ GNOME_MENU_LABEL_SIZE ]; 
    748745    GtkWidget *         p_title_menu; 
    749746    GtkWidget *         p_title_submenu; 
     
    792789            } 
    793790 
    794             snprintf( psz_name, GNOME_TITLE_MENU_SIZE, 
     791            snprintf( psz_name, GNOME_MENU_LABEL_SIZE, 
    795792                      "%d - %d", i_title, i_title + 9 ); 
    796             psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0'; 
     793            psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0'; 
    797794            p_title_menu_item = gtk_menu_item_new_with_label( psz_name ); 
    798795            gtk_widget_show( p_title_menu_item ); 
     
    800797        } 
    801798 
    802         snprintf( psz_name, GNOME_TITLE_MENU_SIZE, "Title %d (%d)", i_title, 
     799        snprintf( psz_name, GNOME_MENU_LABEL_SIZE, "Title %d (%d)", i_title, 
    803800                  p_intf->p_input->stream.pp_areas[i_title]->i_part_nb ); 
    804         psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0'; 
     801        psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0'; 
    805802 
    806803        if( pf_toggle == on_menubar_title_toggle ) 
     
    851848                    } 
    852849 
    853                     snprintf( psz_name, GNOME_TITLE_MENU_SIZE, 
     850                    snprintf( psz_name, GNOME_MENU_LABEL_SIZE, 
    854851                              "%d - %d", i_chapter + 1, i_chapter + 10 ); 
    855                     psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0'; 
     852                    psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0'; 
    856853                    p_chapter_menu_item = 
    857854                            gtk_menu_item_new_with_label( psz_name ); 
     
    860857                } 
    861858 
    862                 snprintf( psz_name, GNOME_TITLE_MENU_SIZE, 
     859                snprintf( psz_name, GNOME_MENU_LABEL_SIZE, 
    863860                          "Chapter %d", i_chapter + 1 ); 
    864                 psz_name[ GNOME_TITLE_MENU_SIZE - 1 ] = '\0'; 
     861                psz_name[ GNOME_MENU_LABEL_SIZE - 1 ] = '\0'; 
    865862     
    866863                p_item = gtk_radio_menu_item_new_with_label( 
     
    971968        GnomeTitleMenu( p_intf, p_menubar_menu, on_menubar_title_toggle ); 
    972969 
    973         snprintf( psz_title, 5, "%d", 
     970        snprintf( psz_title, 4, "%d", 
    974971                  p_intf->p_input->stream.p_selected_area->i_id ); 
    975972        psz_title[ 4 ] = '\0'; 
     
    991988        GnomeChapterMenu( p_intf, p_menubar_menu, on_menubar_chapter_toggle ); 
    992989 
    993         snprintf( psz_chapter, 5, "%d",  
     990        snprintf( psz_chapter, 4, "%d",  
    994991                  p_intf->p_input->stream.p_selected_area->i_part ); 
    995992        psz_chapter[ 4 ] = '\0'; 
  • plugins/gnome/intf_gnome.h

    r26300bb rf367fea  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: intf_gnome.h,v 1.8 2001/04/22 00:08:26 stef Exp $ 
     5 * $Id: intf_gnome.h,v 1.9 2001/05/01 15:12:22 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    2323 
    2424/***************************************************************************** 
    25  * drag'n'drop stuff 
     25 * Drag'n'drop stuff 
    2626 *****************************************************************************/ 
    2727#define DROP_ACCEPT_TEXT_URI_LIST  0 
     
    2929 
    3030/***************************************************************************** 
    31  * interface modes 
     31 * Interface modes 
    3232 *****************************************************************************/ 
    3333#define FILE_MODE   0 
     
    3535#define DVD_MODE    2 
    3636#define VCD_MODE    3 
     37 
     38/***************************************************************************** 
     39 * String sizes 
     40 *****************************************************************************/ 
     41#define GNOME_MENU_LABEL_SIZE 64 
    3742 
    3843/***************************************************************************** 
     
    8489 
    8590} intf_sys_t; 
     91 
  • plugins/gtk/intf_gtk.c

    rc0138ec rf367fea  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: intf_gtk.c,v 1.14 2001/04/27 16:08:26 sam Exp $ 
     5 * $Id: intf_gtk.c,v 1.15 2001/05/01 15:12:22 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    604604{ 
    605605    intf_thread_t *     p_intf; 
    606     char                psz_name[10]; 
     606    char                psz_name[ GTK_MENU_LABEL_SIZE ]; 
    607607    GtkWidget *         p_chapter_menu; 
    608608    GtkWidget *         p_item; 
     
    625625                     == i_chapter + 1 ) ? 1 : 0; 
    626626         
    627         sprintf( psz_name, "Chapter %d", i_chapter + 1 ); 
     627        snprintf( psz_name, GTK_MENU_LABEL_SIZE, 
     628                  "Chapter %d", i_chapter + 1 ); 
     629        psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0'; 
    628630 
    629631        p_item = GtkMenuRadioItem( p_chapter_menu, &p_chapter_button_group, 
     
    658660{ 
    659661    intf_thread_t *     p_intf; 
    660     char                psz_name[10]; 
     662    char                psz_name[ GTK_MENU_LABEL_SIZE ]; 
    661663    GtkWidget *         p_title_menu; 
    662664    GtkWidget *         p_title_item; 
     
    683685        b_active = ( p_intf->p_input->stream.pp_areas[i_title] == 
    684686                     p_intf->p_input->stream.p_selected_area ) ? 1 : 0; 
    685         sprintf( psz_name, "Title %d", i_title ); 
     687        snprintf( psz_name, GTK_MENU_LABEL_SIZE, "Title %d", i_title ); 
     688        psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0'; 
    686689 
    687690        p_title_item = GtkMenuRadioItem( p_title_menu, &p_title_button_group, 
     
    708711                             == i_chapter + 1 ) ? 1 : 0; 
    709712                 
    710                 sprintf( psz_name, "Chapter %d", i_chapter + 1 ); 
     713                snprintf( psz_name, GTK_MENU_LABEL_SIZE, 
     714                          "Chapter %d", i_chapter + 1 ); 
     715                psz_name[ GTK_MENU_LABEL_SIZE - 1 ] = '\0'; 
    711716     
    712717                p_item = GtkMenuRadioItem( p_chapter_menu, 
  • plugins/gtk/intf_gtk.h

    ra0c1805 rf367fea  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: intf_gtk.h,v 1.1 2001/03/15 01:42:20 sam Exp $ 
     5 * $Id: intf_gtk.h,v 1.2 2001/05/01 15:12:22 sam Exp $ 
    66 * 
    77 * Authors: Samuel Hocevar <sam@zoy.org> 
     
    2323 
    2424/***************************************************************************** 
    25  * drag'n'drop stuff 
     25 * Drag'n'drop stuff 
    2626 *****************************************************************************/ 
    2727#define DROP_ACCEPT_TEXT_URI_LIST  0 
     
    2929 
    3030/***************************************************************************** 
    31  * useful inline function 
     31 * String sizes 
     32 *****************************************************************************/ 
     33#define GTK_MENU_LABEL_SIZE 64 
     34 
     35/***************************************************************************** 
     36 * Useful inline function 
    3237 ****************************************************************************/ 
    3338static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent ) 
  • src/video_parser/video_parser.c

    r5435563 rf367fea  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: video_parser.c,v 1.83 2001/05/01 12:22:18 sam Exp $ 
     5 * $Id: video_parser.c,v 1.84 2001/05/01 15:12:22 sam Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    9595    p_vpar->p_fifo = p_config->decoder_config.p_decoder_fifo; 
    9696    p_vpar->p_config = p_config; 
     97    p_vpar->p_vout = NULL; 
    9798 
    9899    /* 
  • src/video_parser/vpar_headers.c

    r5435563 rf367fea  
    33 ***************************************************************************** 
    44 * Copyright (C) 1999, 2000 VideoLAN 
    5  * $Id: vpar_headers.c,v 1.84 2001/05/01 12:22:18 sam Exp $ 
     5 * $Id: vpar_headers.c,v 1.85 2001/05/01 15:12:22 sam Exp $ 
    66 * 
    77 * Authors: Christophe Massiot <massiot@via.ecp.fr> 
     
    459459            intf_Msg( "vpar: no vout present, spawning one" ); 
    460460            p_main->p_vout = vout_CreateThread( NULL ); 
     461 
     462            /* Spawning another one for fun */ 
     463            //vout_CreateThread( NULL ); 
    461464        } 
    462465