diff options
author | chcunningham <chcunningham@chromium.org> | 2015-10-19 18:42:09 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-20 01:42:56 +0000 |
commit | 9812dd8df19bc65839f48d914a1c4e296107a49a (patch) | |
tree | 71925688be60d95b7a73518e0c704c142ff0ccab /media/base/video_decoder_config.h | |
parent | 2c81561ee4f6bf0f19810070ce594c2a109b4e03 (diff) | |
download | chromium_src-9812dd8df19bc65839f48d914a1c4e296107a49a.zip chromium_src-9812dd8df19bc65839f48d914a1c4e296107a49a.tar.gz chromium_src-9812dd8df19bc65839f48d914a1c4e296107a49a.tar.bz2 |
Fail playback when VideoDecoderConfig has invalid extra data.
Invalid extra data occurs when:
(extra_data_ptr == NULL) != (extra_data_size == 0)
We were previously crashing (CHECK) on this condition.
{Audio|Video}DecoderConfig now use a vector and pointer/size issues
are detected/handled in the path of creating the FFmpegDemuxerStream.
Skipping presubmit due to formatting issues. I'd like to have some hope of merging this back to dev.
NOPRESUBMIT=true
BUG=517163
TEST=New unit test. Manually verified graceful failure for MSE & SRC=
R=bbudge@chromium.org, gunsch@chromium.org, sandersd@chromium.org, xhwang@chromium.org
Review URL: https://codereview.chromium.org/1396583002
Cr-Commit-Position: refs/heads/master@{#354952}
Diffstat (limited to 'media/base/video_decoder_config.h')
-rw-r--r-- | media/base/video_decoder_config.h | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/media/base/video_decoder_config.h b/media/base/video_decoder_config.h index 0dae77c8..3de0d2f 100644 --- a/media/base/video_decoder_config.h +++ b/media/base/video_decoder_config.h @@ -35,8 +35,7 @@ class MEDIA_EXPORT VideoDecoderConfig { const gfx::Size& coded_size, const gfx::Rect& visible_rect, const gfx::Size& natural_size, - const uint8* extra_data, - size_t extra_data_size, + const std::vector<uint8_t>& extra_data, bool is_encrypted); ~VideoDecoderConfig(); @@ -49,8 +48,7 @@ class MEDIA_EXPORT VideoDecoderConfig { const gfx::Size& coded_size, const gfx::Rect& visible_rect, const gfx::Size& natural_size, - const uint8* extra_data, - size_t extra_data_size, + const std::vector<uint8_t>& extra_data, bool is_encrypted); // Returns true if this object has appropriate configuration values, false @@ -91,8 +89,7 @@ class MEDIA_EXPORT VideoDecoderConfig { // Optional byte data required to initialize video decoders, such as H.264 // AAVC data. - const uint8* extra_data() const; - size_t extra_data_size() const { return extra_data_.size(); } + const std::vector<uint8_t>& extra_data() const { return extra_data_; } // Whether the video stream is potentially encrypted. // Note that in a potentially encrypted video stream, individual buffers @@ -110,7 +107,7 @@ class MEDIA_EXPORT VideoDecoderConfig { gfx::Rect visible_rect_; gfx::Size natural_size_; - std::vector<uint8> extra_data_; + std::vector<uint8_t> extra_data_; bool is_encrypted_; |