Ticket #5952: libs_libmythtv-vdpau-uninit.patch

File libs_libmythtv-vdpau-uninit.patch, 3.3 KB (added by Erik Hovland <erik@…>, 17 years ago)

Initialize all members in the VDPAU class ctor

  • mythtv/libs/libmythtv/util-vdpau.cpp

    Make sure variables are never used uninitialized.
    
    From: Erik Hovland <erik@hovland.org>
    
    
    ---
    
     mythtv/libs/libmythtv/util-vdpau.cpp |   35 +++++++++++++++++++++++++++++++---
     1 files changed, 32 insertions(+), 3 deletions(-)
    
    
    diff --git a/mythtv/libs/libmythtv/util-vdpau.cpp b/mythtv/libs/libmythtv/util-vdpau.cpp
    index 5280447..fd6179f 100644
    a b VDPAUContext::VDPAUContext()  
    5757    pipVideoSurface(0),     pipOutputSurface(0),
    5858    pipVideoMixer(0),       pipReady(0),       pipAlpha(0),
    5959    vdp_flip_target(NULL),  vdp_flip_queue(NULL),
    60     vdp_device(NULL),       errored(false)
     60    vdp_device(NULL),       errored(false),
     61    vdp_get_proc_address(NULL), vdp_device_destroy(NULL), vdp_get_error_string(NULL),
     62    vdp_get_api_version(NULL), vdp_get_information_string(NULL),
     63    vdp_video_surface_create(NULL), vdp_video_surface_destroy(NULL),
     64    vdp_video_surface_put_bits_y_cb_cr(NULL), vdp_video_surface_get_bits_y_cb_cr(NULL),
     65    vdp_video_surface_query_get_put_bits_y_cb_cr_capabilities(NULL),
     66    vdp_video_surface_query_capabilities(NULL), vdp_output_surface_put_bits_y_cb_cr(NULL),
     67    vdp_output_surface_put_bits_native(NULL), vdp_output_surface_create(NULL),
     68    vdp_output_surface_destroy(NULL), vdp_output_surface_render_bitmap_surface(NULL),
     69    vdp_output_surface_query_capabilities(NULL),
     70    vdp_video_mixer_create(NULL), vdp_video_mixer_set_feature_enables(NULL),
     71    vdp_video_mixer_destroy(NULL), vdp_video_mixer_render(NULL),
     72    vdp_video_mixer_set_attribute_values(NULL), vdp_video_mixer_query_feature_support(NULL),
     73    vdp_video_mixer_query_attribute_support(NULL), vdp_video_mixer_query_parameter_support(NULL),
     74    vdp_generate_csc_matrix(NULL),
     75    vdp_presentation_queue_target_destroy(NULL), vdp_presentation_queue_create(NULL),
     76    vdp_presentation_queue_destroy(NULL), vdp_presentation_queue_display(NULL),
     77    vdp_presentation_queue_block_until_surface_idle(NULL), vdp_presentation_queue_target_create_x11(NULL),
     78    vdp_presentation_queue_query_surface_status(NULL),
     79    vdp_decoder_create(NULL), vdp_decoder_destroy(NULL), vdp_decoder_render(NULL),
     80    vdp_bitmap_surface_create(NULL), vdp_bitmap_surface_destroy(NULL),
     81    vdp_bitmap_surface_put_bits_native(NULL), vdp_bitmap_surface_query_capabilities(NULL)
    6182{
     83    memset(outputSurfaces, 0, sizeof(outputSurfaces));
     84    memset(&outRect, 0, sizeof(outRect));
     85    memset(&outRectVid, 0, sizeof(outRectVid));
     86    memset(&osdLayer, 0, sizeof(osdLayer));
     87    memset(&osdRect, 0, sizeof(osdRect));
     88    memset(&proCamp, 0, sizeof(proCamp));
     89    memset(&pipLayer, 0, sizeof(pipLayer));
     90    memset(&pipPosition, 0, sizeof(pipPosition));
    6291}
    6392
    6493VDPAUContext::~VDPAUContext()
    bool VDPAUContext::CheckCodecSupported(MythCodecID myth_codec_id)  
    13901419    if (!screen)
    13911420        ok = false;
    13921421
    1393     VdpDevice device;
     1422    VdpDevice device = 0;
    13941423    VdpGetProcAddress * vdp_proc_address;
    13951424    VdpStatus vdp_st;
    13961425    VdpGetErrorString * vdp_get_error_string;
    bool VDPAUContext::CheckCodecSupported(MythCodecID myth_codec_id)  
    14081437    }
    14091438
    14101439    VdpDecoderQueryCapabilities * decoder_query;
    1411     VdpDeviceDestroy * device_destroy;
     1440    VdpDeviceDestroy * device_destroy = 0;
    14121441
    14131442    if (ok)
    14141443    {