Opened 6 years ago

Closed 6 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:
Has a Patch: yes 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 6 years ago.
Patch
report-9QlBqW.html (172.8 KB) - added by mt 6 years ago.
Report by Clang Static Analyzer - 1
report-mq2NP5.html (172.3 KB) - added by mt 6 years ago.
Report by Clang Static Analyzer - 2
0012-Fix-forming-reference-to-null-pointer.2.patch (1.6 KB) - added by mt 6 years ago.
New patch

Download all attachments as: .zip

Change History (8)

comment:1 Changed 6 years ago by mt

Has a Patch: set

Changed 6 years ago by mt

Attachment: report-9QlBqW.html added

Report by Clang Static Analyzer - 1

Changed 6 years ago by mt

Attachment: report-mq2NP5.html added

Report by Clang Static Analyzer - 2

comment:2 Changed 6 years ago by korli

Using an else block would fit better:

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

comment:3 Changed 6 years ago by mt

Korli, Thanks reviewing. I rewrite the patch.

Changed 6 years ago by mt

New patch

comment:4 Changed 6 years ago by korli

Resolution: fixed
Status: newclosed

Fixed the style and committed in hrev45894. Thanks!

Note: See TracTickets for help on using tickets.