diff options
author | Boyuan Yang <byang@debian.org> | 2022-07-14 15:56:59 -0400 |
---|---|---|
committer | Boyuan Yang <byang@debian.org> | 2022-07-14 15:56:59 -0400 |
commit | 1a2e17bd28a068714658551c8c355171ce15dfa0 (patch) | |
tree | db9e739007016850ee355365874a20b07034ef2c /src/utils/segmentation_map.cc | |
parent | a08da9600832caf817125edee2c3206fe24cd5cb (diff) | |
parent | d4dbf19f6b0181ee78034bfe4caf189d1c016998 (diff) | |
download | libgav1-1a2e17bd28a068714658551c8c355171ce15dfa0.tar.gz libgav1-1a2e17bd28a068714658551c8c355171ce15dfa0.tar.bz2 libgav1-1a2e17bd28a068714658551c8c355171ce15dfa0.zip |
Update upstream source from tag 'upstream/0.18.0'
Update to upstream version '0.18.0'
with Debian dir a69c1f7f3e7109393a3f9f5f1a2e7a5c3d3eda9f
Diffstat (limited to 'src/utils/segmentation_map.cc')
-rw-r--r-- | src/utils/segmentation_map.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/utils/segmentation_map.cc b/src/utils/segmentation_map.cc index 4284ca2..bbf40c3 100644 --- a/src/utils/segmentation_map.cc +++ b/src/utils/segmentation_map.cc @@ -21,9 +21,12 @@ namespace libgav1 { bool SegmentationMap::Allocate(int32_t rows4x4, int32_t columns4x4) { + if (rows4x4 * columns4x4 > rows4x4_ * columns4x4_) { + segment_id_buffer_.reset(new (std::nothrow) int8_t[rows4x4 * columns4x4]); + } + rows4x4_ = rows4x4; columns4x4_ = columns4x4; - segment_id_buffer_.reset(new (std::nothrow) int8_t[rows4x4_ * columns4x4_]); if (segment_id_buffer_ == nullptr) return false; segment_id_.Reset(rows4x4_, columns4x4_, segment_id_buffer_.get()); return true; |