Check the return value of fread
Showing the changes to test/decoder/DecUT_DecExt.cpp (1 of 1 file). Show all
Unified · Split
| @@ -130,7 +130,7 @@ void DecoderInterfaceTest::DecoderBs (const char* sFileName) { · 129 unmodified lines | |||
| 130 | iFileSize = (int32_t) ftell (pH264File); | 130 | iFileSize = (int32_t) ftell (pH264File); |
| 131 | fseek (pH264File, 0L, SEEK_SET); | 131 | fseek (pH264File, 0L, SEEK_SET); |
| 132 | pBuf = new uint8_t[iFileSize + 4]; | 132 | pBuf = new uint8_t[iFileSize + 4]; |
| 133 | fread (pBuf, 1, iFileSize, pH264File); | 133 | ASSERT_EQ(fread (pBuf, 1, iFileSize, pH264File), (unsigned int) iFileSize); |
| 134 | memcpy (pBuf + iFileSize, &uiStartCode[0], 4); //confirmed_safe_unsafe_usage | 134 | memcpy (pBuf + iFileSize, &uiStartCode[0], 4); //confirmed_safe_unsafe_usage |
| 135 | while (true) { | 135 | while (true) { |
| 136 | if (iBufPos >= iFileSize) { | 136 | if (iBufPos >= iFileSize) { |