History

Initialize the frame buffer in EncodeDecodeTestAPIBase::InitialEncDec

This avoids use of uninitialized data (valgrind errors) in EncodeDecodeTestAPI.ScreenContent_LosslessLink0_EnableLongTermReference. Normally the buffer is initialized separately for each encoded frame if using EncodeDecodeTestAPIBase::EncodeOneFrame, but for tests that use encoder_->EncodeFrame directly, make sure the data always is initialized.

Martin Storsjö committed 8 years ago

Commit 5bf4e371 parent bbfc8401 file · +1 −5Browse files

Showing the changes to test/api/encode_options_test.cpp (1 of 1 file). Show all

Unified · Split

test/api/encode_options_test.cpp+1−5
@@ -36,6 +36,7 @@ bool EncodeDecodeTestAPIBase::InitialEncDec (int iWidth, int iHeight) { · 35 unmodified lines
3636
3737 //set a fixed random value
3838 iRandValue = rand() % 256;
39+ memset (buf_.data(), iRandValue, frameSize);
3940 return true;
4041 }
4142
@@ -2158,11 +2159,6 @@ TEST_F (EncodeDecodeTestAPI, UnsupportedVideoSizeInput) { · 2116 unmodified lines
21582159
21592160 ASSERT_TRUE (InitialEncDec (iSrcWidth, iSrcHeight));
21602161
2161− int frameSize = EncPic.iPicWidth * EncPic.iPicHeight * 3 / 2;
2162− int lumaSize = EncPic.iPicWidth * EncPic.iPicHeight;
2163− memset (buf_.data(), iRandValue, lumaSize);
2164− memset (buf_.data() + lumaSize, rand() % 256, (frameSize - lumaSize));
2165−
21662162 iRet = encoder_->EncodeFrame (&EncPic, &info);
21672163
21682164 ASSERT_TRUE (iRet == cmResultSuccess) << "rv = " << iRet;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t