openh264
openh264 copied to clipboard
Invalid read in EncUT_GetIntraPredictor.cpp
In the code below pRef is allocated to size kiStride3 + 1, then pRef is incremented, and then pRef[kiStride3] is referenced which is now off the end of the array.
From EncUT_GetIntraPredector.cpp:35
uint8_t *pRef = new uint8_t[kiStride3+1];
for (int i=0; i<(static_cast<int32_t>(kiStride3+1)); i++) pRef[i] = rand() % 256;
pRef++;
const uint8_t kuiH1 = pRef[-1]; const uint8_t kuiH2 = pRef[kiStride-1]; const uint8_t kuiH3 = pRef[kiStride2]; const uint8_t kuiH4 = pRef[kiStride3];
Should be fixed by pull req #957