Skip to content
Snippets Groups Projects
Commit d288c64f authored by Ben Boeckel's avatar Ben Boeckel Committed by Code Review
Browse files

Merge topic 'prevent-buffer-overflow' into master

d7ec6c1b AVIWriter: Fix a comment typo
3e7585ca AVIWriter: Don't overflow the fourcc storage
parents 304b8b22 d7ec6c1b
No related branches found
No related tags found
No related merge requests found
......@@ -141,7 +141,8 @@ void vtkAVIWriter::Start()
char fourcc[4] = {' ', ' ', ' ', ' '};
if (this->CompressorFourCC)
{
memcpy(fourcc, this->CompressorFourCC, strlen(this->CompressorFourCC));
size_t len = strlen(this->CompressorFourCC);
memcpy(fourcc, this->CompressorFourCC, len > 4 ? 4 : len);
}
opts.fccHandler=mmioFOURCC(fourcc[0], fourcc[1], fourcc[2], fourcc[3]);
switch (this->GetQuality())
......
......@@ -70,7 +70,7 @@ public:
// Common identifiers include DIVX, XVID, and H264.
// http://en.wikipedia.org/wiki/FourCC.
// Default value is:
// - msvc
// - MSVC
// Other examples include:
// - DIB: Full Frames (Uncompressed)
// - LAGS: Lagarith Lossless Codec
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment