Opened 11 years ago

Closed 11 years ago

#9883 closed bug (fixed)

[Cortex] MediaFormatIO.cpp: Forming reference to null pointer

Reported by: mt Owned by:
Priority: normal Milestone: R1
Component: Applications/Cortex Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

In MediaFormatIO::xmlImportChild(), if childAsFormat is NULL, childAsFormat->m_format.u.raw_audio and childAsFormat->m_format.u.raw_video are invalid. Please see attached report.

Attachments (4)

0012-Fix-forming-reference-to-null-pointer.patch (1.4 KB ) - added by mt 11 years ago.
Patch
report-9QlBqW.html (172.8 KB ) - added by mt 11 years ago.
Report by Clang Static Analyzer - 1
report-mq2NP5.html (172.3 KB ) - added by mt 11 years ago.
Report by Clang Static Analyzer - 2
0012-Fix-forming-reference-to-null-pointer.2.patch (1.6 KB ) - added by mt 11 years ago.
New patch

Download all attachments as: .zip

Change History (8)

comment:1 by mt, 11 years ago

patch: 01

by mt, 11 years ago

Attachment: report-9QlBqW.html added

Report by Clang Static Analyzer - 1

by mt, 11 years ago

Attachment: report-mq2NP5.html added

Report by Clang Static Analyzer - 2

comment:2 by korli, 11 years ago

Using an else block would fit better:

   if (error_condition) {
      report_error();
   } else {
      output = ...
   }

comment:3 by mt, 11 years ago

Korli, Thanks reviewing. I rewrite the patch.

comment:4 by korli, 11 years ago

Resolution: fixed
Status: newclosed

Fixed the style and committed in hrev45894. Thanks!

Note: See TracTickets for help on using tickets.