From da095b73152042c5b7370179c5f5700dc21cedf7 Mon Sep 17 00:00:00 2001
From: Murai Takashi <tmurai01@gmail.com>
Date: Mon, 22 Jul 2013 20:48:17 +0900
Subject: [PATCH] Fix forming reference to null pointer
---
.../cortex/Persistence/Wrappers/MediaFormatIO.cpp | 16 ++++++++++++----
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/src/apps/cortex/Persistence/Wrappers/MediaFormatIO.cpp b/src/apps/cortex/Persistence/Wrappers/MediaFormatIO.cpp
index 9d613db..ef2f825 100644
a
|
b
|
void MediaFormatIO::xmlImportChild(
|
1299 | 1299 | |
1300 | 1300 | MediaFormatIO* childAsFormat = dynamic_cast<MediaFormatIO*>(child); |
1301 | 1301 | if(m_format.type == B_MEDIA_ENCODED_AUDIO) { |
1302 | | if(!childAsFormat || childAsFormat->m_format.type != B_MEDIA_RAW_AUDIO) |
| 1302 | if(!childAsFormat || |
| 1303 | childAsFormat->m_format.type != B_MEDIA_RAW_AUDIO) { |
1303 | 1304 | context.reportError("Expected a raw_audio_format."); |
1304 | | m_format.u.encoded_audio.output = childAsFormat->m_format.u.raw_audio; |
| 1305 | } else { |
| 1306 | m_format.u.encoded_audio.output = |
| 1307 | childAsFormat->m_format.u.raw_audio; |
| 1308 | } |
1305 | 1309 | } |
1306 | 1310 | else if(m_format.type == B_MEDIA_ENCODED_VIDEO) { |
1307 | | if(!childAsFormat || childAsFormat->m_format.type != B_MEDIA_RAW_VIDEO) |
| 1311 | if(!childAsFormat || |
| 1312 | childAsFormat->m_format.type != B_MEDIA_RAW_VIDEO) { |
1308 | 1313 | context.reportError("Expected a raw_video_format."); |
1309 | | m_format.u.encoded_video.output = childAsFormat->m_format.u.raw_video; |
| 1314 | } else { |
| 1315 | m_format.u.encoded_video.output = |
| 1316 | childAsFormat->m_format.u.raw_video; |
| 1317 | } |
1310 | 1318 | } |
1311 | 1319 | else { |
1312 | 1320 | // +++++ should this be an error? |