Changeset 1425

Show
Ignore:
Timestamp:
11/09/08 20:52:03 (12 years ago)
Author:
jwoithe
Message:

MOTU: fix a NULL pointer dereference for devices without mixer definitions which I thought I fixed some months ago (thanks to Peter Peter McCormick? for spotting this)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/libffado-2.0/src/motu/motu_avdevice.cpp

    r1423 r1425  
    521521        debugOutput(DEBUG_LEVEL_WARNING, "No mixer controls defined for model %d\n", m_motu_model); 
    522522        result = false; 
    523     } 
    524     const struct MatrixMixBus *buses = DevicesProperty[m_motu_model-1].mixer->mixer_buses; 
    525     if (buses == NULL) { 
    526         debugOutput(DEBUG_LEVEL_WARNING, "No buses defined for model %d\n", m_motu_model); 
    527         result = false; 
    528     } 
    529     const struct MatrixMixChannel *channels = DevicesProperty[m_motu_model-1].mixer->mixer_channels; 
    530     if (channels == NULL) { 
    531         debugOutput(DEBUG_LEVEL_WARNING, "No channels defined for model %d\n", m_motu_model); 
    532         result = false; 
     523    } else { 
     524        const struct MatrixMixBus *buses = DevicesProperty[m_motu_model-1].mixer->mixer_buses; 
     525        if (buses == NULL) { 
     526            debugOutput(DEBUG_LEVEL_WARNING, "No buses defined for model %d\n", m_motu_model); 
     527            result = false; 
     528        } 
     529        const struct MatrixMixChannel *channels = DevicesProperty[m_motu_model-1].mixer->mixer_channels; 
     530        if (channels == NULL) { 
     531            debugOutput(DEBUG_LEVEL_WARNING, "No channels defined for model %d\n", m_motu_model); 
     532            result = false; 
     533        } 
    533534    } 
    534535    if (result == false) {