Ticket #9883: 0012-Fix-forming-reference-to-null-pointer.patch

File 0012-Fix-forming-reference-to-null-pointer.patch, 1.4 KB (added by mt, 11 years ago)

Patch

  • src/apps/cortex/Persistence/Wrappers/MediaFormatIO.cpp

    From 4d9d391e8392c6084d93dede0f55ea2aa4431ed2 Mon Sep 17 00:00:00 2001
    From: Murai Takashi <tmurai01@gmail.com>
    Date: Thu, 18 Jul 2013 19:35:43 +0900
    Subject: [PATCH] Fix forming reference to null pointer
    
    ---
     .../cortex/Persistence/Wrappers/MediaFormatIO.cpp  |   10 ++++++++--
     1 file changed, 8 insertions(+), 2 deletions(-)
    
    diff --git a/src/apps/cortex/Persistence/Wrappers/MediaFormatIO.cpp b/src/apps/cortex/Persistence/Wrappers/MediaFormatIO.cpp
    index 9d613db..cdfe79d 100644
    a b void MediaFormatIO::xmlImportChild(  
    13011301    if(m_format.type == B_MEDIA_ENCODED_AUDIO) {
    13021302        if(!childAsFormat || childAsFormat->m_format.type != B_MEDIA_RAW_AUDIO)
    13031303            context.reportError("Expected a raw_audio_format.");
    1304         m_format.u.encoded_audio.output = childAsFormat->m_format.u.raw_audio;
     1304
     1305        if(childAsFormat)
     1306            m_format.u.encoded_audio.output =
     1307                childAsFormat->m_format.u.raw_audio;
    13051308    }
    13061309    else if(m_format.type == B_MEDIA_ENCODED_VIDEO) {
    13071310        if(!childAsFormat || childAsFormat->m_format.type != B_MEDIA_RAW_VIDEO)
    13081311            context.reportError("Expected a raw_video_format.");
    1309         m_format.u.encoded_video.output = childAsFormat->m_format.u.raw_video;
     1312
     1313        if(childAsFormat)
     1314            m_format.u.encoded_video.output =
     1315                childAsFormat->m_format.u.raw_video;
    13101316    }
    13111317    else {
    13121318        // +++++ should this be an error?