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

Unified Diff: webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.cc

Issue 2352063002: Fix modules_unittests on iOS. (Closed)
Patch Set: fix sizes 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
Index: webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.cc
diff --git a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.cc b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.cc
index c6c0406128f05d2c818b0a94212ea5cb1377bc60..2bc1d8f53be8ab6280d17ac22b7303925f1cf712 100644
--- a/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.cc
+++ b/webrtc/modules/video_coding/codecs/h264/h264_video_toolbox_nalu.cc
@@ -264,10 +264,10 @@ bool H264AnnexBBufferHasVideoFormatDescription(const uint8_t* annexb_buffer,
if (is_first_nalu_type_sps)
return true;
bool is_first_nalu_type_aud = first_nalu_type == kAud;
- // Start code + access unit delimiter + start code = 4 + 2 + 4 = 10.
- if (!is_first_nalu_type_aud || annexb_buffer_size <= 10u)
+ // Start code + access unit delimiter + start code = 4 + 1 + 4 = 9.
tkchin_webrtc 2016/09/28 10:35:02 I looked and I think that 10 is correct start code
kthelgason 2016/09/28 10:46:45 You're right, I forgot to count the type byte. Add
+ if (!is_first_nalu_type_aud || annexb_buffer_size <= 9u)
return false;
- NaluType second_nalu_type = ParseNaluType(annexb_buffer[10]);
+ NaluType second_nalu_type = ParseNaluType(annexb_buffer[9]);
bool is_second_nalu_type_sps = second_nalu_type == kSps;
return is_second_nalu_type_sps;
}

Powered by Google App Engine
This is Rietveld 408576698