]> granicus.if.org Git - libvpx/commitdiff
buffer.h: Only allow Init() to be called once.
authorJohann <johannkoenig@google.com>
Wed, 7 Jun 2017 19:25:05 +0000 (12:25 -0700)
committerJohann <johannkoenig@google.com>
Wed, 28 Jun 2017 17:59:39 +0000 (10:59 -0700)
Change-Id: I041c8b6f314802833c5287a176dbfeec9461b08e

test/buffer.h

index 8fbab227018e25037a9f8c158f996115191c9633..ec4dfbe7b11b0bdd3c56c72ba6f102f335310dfe 100644 (file)
@@ -95,6 +95,7 @@ class Buffer {
   bool CheckValues(const Buffer<T> &a) const;
 
   bool Init() {
+    if (raw_buffer_ != NULL) return false;
     EXPECT_GT(width_, 0);
     EXPECT_GT(height_, 0);
     EXPECT_GE(top_padding_, 0);