Index: content/common/gpu/gpu_messages.cc |
diff --git a/content/common/gpu/gpu_messages.cc b/content/common/gpu/gpu_messages.cc |
index 9c90693c33adeb42fca5cf2ea48896c65fd4bb44..7512a7877195f4749bcee79ed43181272725da2f 100644 |
--- a/content/common/gpu/gpu_messages.cc |
+++ b/content/common/gpu/gpu_messages.cc |
@@ -16,6 +16,7 @@ void ParamTraits<media::BitstreamBuffer>::Write(base::Pickle* m, |
const param_type& p) { |
WriteParam(m, p.id()); |
WriteParam(m, static_cast<uint64_t>(p.size())); |
+ WriteParam(m, static_cast<int64_t>(p.offset())); |
dcheng
2016/03/01 01:48:43
Does it make sense to DCHECK() that this is non-ne
Owen Lin
2016/03/02 02:50:52
I agree with Pawel that
"MapAt() will fail us if t
dcheng
2016/03/02 05:58:20
It's not in the contract of SharedMemory::MapAt(),
|
WriteParam(m, p.presentation_timestamp()); |
WriteParam(m, p.key_id()); |
if (!p.key_id().empty()) { |
@@ -30,7 +31,9 @@ bool ParamTraits<media::BitstreamBuffer>::Read(const base::Pickle* m, |
param_type* r) { |
DCHECK(r); |
uint64_t size = 0; |
+ int64_t offset = 0; |
if (!(ReadParam(m, iter, &r->id_) && ReadParam(m, iter, &size) && |
+ ReadParam(m, iter, &offset) && |
ReadParam(m, iter, &r->presentation_timestamp_) && |
ReadParam(m, iter, &r->key_id_))) |
return false; |
@@ -42,6 +45,13 @@ bool ParamTraits<media::BitstreamBuffer>::Read(const base::Pickle* m, |
} |
r->size_ = checked_size.ValueOrDie(); |
+ base::CheckedNumeric<off_t> checked_offset(offset); |
+ if (!checked_offset.IsValid()) { |
dcheng
2016/03/01 01:48:43
Similarly, does it make sense to assert that the v
Owen Lin
2016/03/02 02:50:52
See above.
|
+ DLOG(ERROR) << "Invalid offset: " << offset; |
+ return false; |
+ } |
+ r->offset_ = checked_offset.ValueOrDie(); |
+ |
if (!r->key_id_.empty()) { |
if (!(ReadParam(m, iter, &r->iv_) && ReadParam(m, iter, &r->subsamples_))) |
return false; |