Skip to content

Commit 88c2d75

Browse files
authored
fix(exr): did not properly allocate 'missingcolor' vector (#4751)
Oops, this internal vector called `reserve()` and then filled in results. Should have been `resize()`. Signed-off-by: Larry Gritz <lg@larrygritz.com>
1 parent e787dc6 commit 88c2d75

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/openexr.imageio/exrinput.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ OpenEXRInput::open(const std::string& name, ImageSpec& newspec,
250250
// missingcolor as numeric array
251251
int n = m->type().basevalues();
252252
m_missingcolor.clear();
253-
m_missingcolor.reserve(n);
253+
m_missingcolor.resize(n);
254254
for (int i = 0; i < n; ++i)
255255
m_missingcolor[i] = m->get_float(i);
256256
}

src/openexr.imageio/exrinput_c.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ OpenEXRCoreInput::open(const std::string& name, ImageSpec& newspec,
368368
// missingcolor as numeric array
369369
int n = m->type().basevalues();
370370
m_missingcolor.clear();
371-
m_missingcolor.reserve(n);
371+
m_missingcolor.resize(n);
372372
for (int i = 0; i < n; ++i)
373373
m_missingcolor[i] = m->get_float(i);
374374
}

0 commit comments

Comments
 (0)