Index: webrtc/common_video/h264/h264_bitstream_parser.cc |
diff --git a/webrtc/common_video/h264/h264_bitstream_parser.cc b/webrtc/common_video/h264/h264_bitstream_parser.cc |
index 048cdd2f6ea58da64b7d4b37507c2e6078a88865..ab97a9081975cde72f041107cdcf937cb94dee65 100644 |
--- a/webrtc/common_video/h264/h264_bitstream_parser.cc |
+++ b/webrtc/common_video/h264/h264_bitstream_parser.cc |
@@ -251,6 +251,12 @@ H264BitstreamParser::Result H264BitstreamParser::ParseNonParameterSetNalu( |
int32_t last_slice_qp_delta; |
RETURN_INV_ON_FAIL( |
slice_reader.ReadSignedExponentialGolomb(&last_slice_qp_delta)); |
+ if (last_slice_qp_delta > 52 || last_slice_qp_delta < -52) { |
magjed_webrtc
2016/11/28 16:41:32
Is the constant 52 specified by the spec? We shoul
pbos-webrtc
2016/11/28 17:15:45
I think you should also add range checking in GetL
kthelgason
2016/11/29 10:27:12
Yes, and done.
kthelgason
2016/11/29 10:27:12
Yes, and done.
|
+ // Something has gone wrong, and the parsed value is invalid. |
+ LOG(LS_WARNING) << "Parsed QP value out of range."; |
+ return kInvalidStream; |
+ } |
+ |
last_slice_qp_delta_ = rtc::Optional<int32_t>(last_slice_qp_delta); |
return kOk; |
} |