Ticket #4834: libs_libmythtv_viewschdiff.cpp-fix-unchecked-null-returns.patch

File libs_libmythtv_viewschdiff.cpp-fix-unchecked-null-returns.patch, 1023 bytes (added by Erik Hovland <erik@…>, 13 years ago)

checks for pointer null

  • libs/libmythtv/viewschdiff.cpp

    There is an instance in a view schedule class where a caller calls a member
    
    From: Erik Hovland <erik@hovland.org>
    
    function that can return a null pointer but does not check the returned pointer.
    ---
    
     libs/libmythtv/viewschdiff.cpp |    5 +++++
     1 files changed, 5 insertions(+), 0 deletions(-)
    
    diff --git a/libs/libmythtv/viewschdiff.cpp b/libs/libmythtv/viewschdiff.cpp
    index 5794ec4..89cf64d 100644
    a b void ViewScheduleDiff::updateBackground(void) 
    198198    QPainter tmp(&bground);
    199199
    200200    LayerSet *container = theme->GetSet("background");
     201    if (!container)
     202        return;
     203
    201204    container->Draw(&tmp, 0, 0);
    202205
    203206    tmp.end();
    void ViewScheduleDiff::edit() 
    260263void ViewScheduleDiff::upcoming()
    261264{
    262265    ProgramInfo *pi = CurrentProgram();
     266    if (!pi)
     267        return;
    263268
    264269    ProgLister *pl = new ProgLister(plTitle, pi->title, "",
    265270                                   gContext->GetMainWindow(), "proglist");