]> git.sesse.net Git - movit/blobdiff - flat_input_test.cpp
Do not send NULL to glTexSubImage2D if there is no input data set; it is illegal...
[movit] / flat_input_test.cpp
index 741b7c709c63e582b0e301238a6a4adfa684416d..2fb807e945d18f1ad3bcc26eb4b28c6d7b05db6a 100644 (file)
@@ -320,4 +320,24 @@ TEST(FlatInput, ExternalTexture) {
        expect_equal(expected_data, out_data, 4, size);
 }
 
+TEST(FlatInput, NoData) {
+       const int width = 2;
+       const int height = 4;
+
+       float out_data[width * height];
+
+       EffectChainTester tester(NULL, width, height);
+
+       ImageFormat format;
+       format.color_space = COLORSPACE_sRGB;
+       format.gamma_curve = GAMMA_LINEAR;
+
+       FlatInput *input = new FlatInput(format, FORMAT_GRAYSCALE, GL_FLOAT, width, height);
+       tester.get_chain()->add_input(input);
+
+       tester.run(out_data, GL_RED, COLORSPACE_sRGB, GAMMA_LINEAR);
+
+       // Don't care what the output was, just that it does not crash.
+}
+
 }  // namespace movit