openh264 icon indicating copy to clipboard operation
openh264 copied to clipboard

Invalid read in EncUT_GetIntraPredictor.cpp

Open ethanhugg opened this issue 12 years ago • 1 comments

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];

ethanhugg avatar Jun 10 '14 23:06 ethanhugg

Should be fixed by pull req #957

ethanhugg avatar Jun 11 '14 15:06 ethanhugg