Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1574)

Unified Diff: media/formats/mpeg/adts_stream_parser.cc

Issue 2388443002: Fix media_log() crash in fuzzer tests. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mpeg/adts_stream_parser.cc
diff --git a/media/formats/mpeg/adts_stream_parser.cc b/media/formats/mpeg/adts_stream_parser.cc
index 6aa8782ab51102807a4992ee7ad1696665a0de05..1089107b97ac7c18223ffa5eb73610dba38777d8 100644
--- a/media/formats/mpeg/adts_stream_parser.cc
+++ b/media/formats/mpeg/adts_stream_parser.cc
@@ -74,11 +74,13 @@ int ADTSStreamParser::ParseFrameHeader(const uint8_t* data,
if (sync != 0xfff || layer != 0 || frame_length < bytes_read ||
sample_rate_index >= kADTSFrequencyTableSize ||
channel_layout_index >= kADTSChannelLayoutTableSize) {
- MEDIA_LOG(DEBUG, media_log())
- << "Invalid header data :" << std::hex << " sync 0x" << sync
- << " version 0x" << version << " layer 0x" << layer
- << " sample_rate_index 0x" << sample_rate_index
- << " channel_layout_index 0x" << channel_layout_index;
+ if (media_log()) {
+ MEDIA_LOG(DEBUG, media_log())
+ << "Invalid header data :" << std::hex << " sync 0x" << sync
+ << " version 0x" << version << " layer 0x" << layer
+ << " sample_rate_index 0x" << sample_rate_index
+ << " channel_layout_index 0x" << channel_layout_index;
+ }
return -1;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698