Skip to content

Commit

Permalink
encode_api_test.cc: assert encoder is initialized
Browse files Browse the repository at this point in the history
Before proceeding with Encode(). This avoids some static analysis
warnings about uninitialized `cfg_` members.

Change-Id: Ib67b278d6706ab1034219e8c1ad9ba0c5b574ba8
  • Loading branch information
jzern committed May 3, 2024
1 parent 314ee14 commit 108f512
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/encode_api_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,7 @@ void VP8Encoder::Configure(unsigned int threads, unsigned int width,
}

void VP8Encoder::Encode(bool key_frame) {
assert(initialized_);
const vpx_codec_cx_pkt_t *pkt;
vpx_image_t *image =
CreateImage(VPX_BITS_8, VPX_IMG_FMT_I420, cfg_.g_w, cfg_.g_h);
Expand Down Expand Up @@ -977,6 +978,7 @@ void VP9Encoder::Configure(unsigned int threads, unsigned int width,
}

void VP9Encoder::Encode(bool key_frame) {
assert(initialized_);
const vpx_codec_cx_pkt_t *pkt;
vpx_image_t *image = CreateImage(bit_depth_, fmt_, cfg_.g_w, cfg_.g_h);
ASSERT_NE(image, nullptr);
Expand Down

0 comments on commit 108f512

Please sign in to comment.