diff options
author | angiebird <angiebird@google.com> | 2020-06-08 16:46:15 -0700 |
---|---|---|
committer | angiebird <angiebird@google.com> | 2020-06-08 16:46:15 -0700 |
commit | 812eb89b26e6fe458133e90e74b0a11b853df56d (patch) | |
tree | 76236717ec52ee685f441551eb5aaf27ec713ade /vp9/simple_encode.cc | |
parent | e53dc9f2ea81c8f84c90f8acc6ba70f03b37647b (diff) | |
download | libvpx-812eb89b26e6fe458133e90e74b0a11b853df56d.tar libvpx-812eb89b26e6fe458133e90e74b0a11b853df56d.tar.gz libvpx-812eb89b26e6fe458133e90e74b0a11b853df56d.tar.bz2 libvpx-812eb89b26e6fe458133e90e74b0a11b853df56d.zip |
Fix assertion error in simple_encode.cc
Change-Id: I271d11cc35d34d5450a8b56fabcedaf2bb7c6565
Diffstat (limited to 'vp9/simple_encode.cc')
-rw-r--r-- | vp9/simple_encode.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vp9/simple_encode.cc b/vp9/simple_encode.cc index 9d62d26e1..bce52e28c 100644 --- a/vp9/simple_encode.cc +++ b/vp9/simple_encode.cc @@ -848,10 +848,10 @@ T *GetVectorData(const std::vector<T> &v) { static GOP_COMMAND GetGopCommand(const std::vector<int> &gop_map, int start_show_index) { - assert(static_cast<size_t>(start_show_index) < gop_map.size()); - assert((gop_map[start_show_index] & kGopMapFlagStart) != 0); GOP_COMMAND gop_command; if (gop_map.size() > 0) { + assert(static_cast<size_t>(start_show_index) < gop_map.size()); + assert((gop_map[start_show_index] & kGopMapFlagStart) != 0); int end_show_index = start_show_index + 1; // gop_map[end_show_index] & kGopMapFlagStart == 0 means this is // the start of a gop. @@ -1099,7 +1099,8 @@ int SimpleEncode::GetCodingFrameNum() const { } std::vector<int> SimpleEncode::ComputeKeyFrameMap() const { - assert(impl_ptr_->first_pass_stats.size() == num_frames_); + // The last entry of first_pass_stats is the overall stats. + assert(impl_ptr_->first_pass_stats.size() == num_frames_ + 1); vpx_rational_t frame_rate = make_vpx_rational(frame_rate_num_, frame_rate_den_); const VP9EncoderConfig oxcf = |