Fix: Mantaflow: move allocation after early return #121104
|
@ -152,8 +152,6 @@ bool SimpleImage::initFromPpm(std::string filename)
|
|||
rowsize = windW * 3;
|
||||
}
|
||||
|
||||
unsigned char *pic = new unsigned char[size]; // (GLubyte *)malloc (size);
|
||||
|
||||
// Read in maximum value (ignore) , could be scanned with sscanf as well, but this should be
|
||||
// 255... 3rd line
|
||||
if (fgets(line, MAXLINE, fp) == nullptr) {
|
||||
|
@ -162,6 +160,8 @@ bool SimpleImage::initFromPpm(std::string filename)
|
|||
return 0;
|
||||
}
|
||||
|
||||
unsigned char *pic = new unsigned char[size]; // (GLubyte *)malloc (size);
|
||||
|
||||
// Read in the pixel array row-by-row: 1st row = top scanline */
|
||||
unsigned char *ptr = nullptr;
|
||||
ptr = &pic[(windH - 1) * rowsize];
|
||||
|
|
Loading…
Reference in New Issue