Commit 529beccb authored by John Rummell's avatar John Rummell Committed by Commit Bot

Add CHECK for invalid condition in ~DecoderBuffer()

There are crashes during destruction where |side_data_size_| == 0
but |side_data_| contains an invalid pointer. Adding a CHECK for this
in the destructor to hopefully get better data to help isolate the
real problem.

BUG=794740
TEST=media_unittests still pass

Change-Id: Id1633395c544b66ef632445d475a40e57a8aa1b4
Reviewed-on: https://chromium-review.googlesource.com/1185961
Commit-Queue: John Rummell <jrummell@chromium.org>
Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585354}
parent 25dfa3fb
...@@ -51,7 +51,13 @@ DecoderBuffer::DecoderBuffer(std::unique_ptr<UnalignedSharedMemory> shm, ...@@ -51,7 +51,13 @@ DecoderBuffer::DecoderBuffer(std::unique_ptr<UnalignedSharedMemory> shm,
shm_(std::move(shm)), shm_(std::move(shm)),
is_key_frame_(false) {} is_key_frame_(false) {}
DecoderBuffer::~DecoderBuffer() = default; DecoderBuffer::~DecoderBuffer() {
// TODO(crbug.com/794740). As a lot of the crashes have |side_data_size_|
// == 0 yet |side_data| is not null, check that here hoping to get better
// minidumps. This check verifies that size == 0 and |side_data_| is null,
// or size != 0 and |side_data_| not null.
CHECK_EQ(!!side_data_size_, !!side_data_);
}
void DecoderBuffer::Initialize() { void DecoderBuffer::Initialize() {
data_.reset(AllocateFFmpegSafeBlock(size_)); data_.reset(AllocateFFmpegSafeBlock(size_));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment