mirror of
				https://github.com/f4exb/sdrangel.git
				synced 2025-11-04 05:30:32 -05:00 
			
		
		
		
	LimeSDR: fix segfault when trying to get status on the uninitialized stream
This commit is contained in:
		
							parent
							
								
									35f51bcdb2
								
							
						
					
					
						commit
						099aa72fa2
					
				@ -43,6 +43,7 @@ LimeSDRInput::LimeSDRInput(DeviceSourceAPI *deviceAPI) :
 | 
				
			|||||||
    m_running(false),
 | 
					    m_running(false),
 | 
				
			||||||
    m_firstConfig(true)
 | 
					    m_firstConfig(true)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					    m_streamId.handle = 0;
 | 
				
			||||||
    openDevice();
 | 
					    openDevice();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -223,6 +224,7 @@ void LimeSDRInput::closeDevice()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // destroy the stream
 | 
					    // destroy the stream
 | 
				
			||||||
    LMS_DestroyStream(m_deviceShared.m_deviceParams->getDevice(), &m_streamId);
 | 
					    LMS_DestroyStream(m_deviceShared.m_deviceParams->getDevice(), &m_streamId);
 | 
				
			||||||
 | 
					    m_streamId.handle = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // release the channel
 | 
					    // release the channel
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -383,7 +385,7 @@ bool LimeSDRInput::handleMessage(const Message& message)
 | 
				
			|||||||
//        qDebug() << "LimeSDRInput::handleMessage: MsgGetStreamInfo";
 | 
					//        qDebug() << "LimeSDRInput::handleMessage: MsgGetStreamInfo";
 | 
				
			||||||
        lms_stream_status_t status;
 | 
					        lms_stream_status_t status;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (LMS_GetStreamStatus(&m_streamId, &status) < 0)
 | 
					        if (m_streamId.handle && (LMS_GetStreamStatus(&m_streamId, &status) < 0))
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
//            qDebug("LimeSDRInput::handleMessage: canot get stream status");
 | 
					//            qDebug("LimeSDRInput::handleMessage: canot get stream status");
 | 
				
			||||||
            MsgReportStreamInfo *report = MsgReportStreamInfo::create(
 | 
					            MsgReportStreamInfo *report = MsgReportStreamInfo::create(
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user