]> git.sesse.net Git - movit/blobdiff - ycbcr_input_test.cpp
Do not send NULL to glTexSubImage2D if there is no input data set; it is illegal...
[movit] / ycbcr_input_test.cpp
index 463cb7e2d3771180c0d8fe06a65e62bd7931678e..a5032af657de73935aabaef79983b3d7603a28c7 100644 (file)
@@ -688,4 +688,35 @@ TEST(YCbCrTest, WikipediaJPEGMatrices) {
        EXPECT_NEAR(128.0, offset[2] * 255.0, 1e-3);
 }
 
+TEST(YCbCrInputTest, NoData) {
+       const int width = 1;
+       const int height = 5;
+
+       float out_data[4 * width * height];
+
+       EffectChainTester tester(NULL, width, height);
+
+       ImageFormat format;
+       format.color_space = COLORSPACE_sRGB;
+       format.gamma_curve = GAMMA_sRGB;
+
+       YCbCrFormat ycbcr_format;
+       ycbcr_format.luma_coefficients = YCBCR_REC_601;
+       ycbcr_format.full_range = false;
+       ycbcr_format.num_levels = 256;
+       ycbcr_format.chroma_subsampling_x = 1;
+       ycbcr_format.chroma_subsampling_y = 1;
+       ycbcr_format.cb_x_position = 0.5f;
+       ycbcr_format.cb_y_position = 0.5f;
+       ycbcr_format.cr_x_position = 0.5f;
+       ycbcr_format.cr_y_position = 0.5f;
+
+       YCbCrInput *input = new YCbCrInput(format, ycbcr_format, width, height);
+       tester.get_chain()->add_input(input);
+
+       tester.run(out_data, GL_RGBA, COLORSPACE_sRGB, GAMMA_sRGB);
+
+       // Don't care what the output was, just that it does not crash.
+}
+
 }  // namespace movit