File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
media/libstagefright/wifi-display/rtp Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -766,9 +766,15 @@ status_t RTPSender::parseTSFB(const uint8_t *data, size_t size) {
766
766
}
767
767
768
768
status_t RTPSender::parseAPP (const uint8_t *data, size_t size) {
769
- if (!memcmp (" late" , &data[8 ], 4 )) {
770
- int64_t avgLatencyUs = (int64_t )U64_AT (&data[12 ]);
771
- int64_t maxLatencyUs = (int64_t )U64_AT (&data[20 ]);
769
+ static const size_t late_offset = 8 ;
770
+ static const char late_string[] = " late" ;
771
+ static const size_t avgLatencyUs_offset = late_offset + sizeof (late_string) - 1 ;
772
+ static const size_t maxLatencyUs_offset = avgLatencyUs_offset + sizeof (int64_t );
773
+
774
+ if ((size >= (maxLatencyUs_offset + sizeof (int64_t )))
775
+ && !memcmp (late_string, &data[late_offset], sizeof (late_string) - 1 )) {
776
+ int64_t avgLatencyUs = (int64_t )U64_AT (&data[avgLatencyUs_offset]);
777
+ int64_t maxLatencyUs = (int64_t )U64_AT (&data[maxLatencyUs_offset]);
772
778
773
779
sp<AMessage> notify = mNotify ->dup ();
774
780
notify->setInt32 (" what" , kWhatInformSender );
You can’t perform that action at this time.
0 commit comments