diff --git a/src/Clip.cpp b/src/Clip.cpp
index 1970884dc..0035d766e 100644
--- a/src/Clip.cpp
+++ b/src/Clip.cpp
@@ -1150,7 +1150,7 @@ void Clip::apply_keyframes(std::shared_ptr frame, int width, int height)
float alpha_value = alpha.GetValue(frame->number);
// Get source image's pixels
- unsigned char *pixels = (unsigned char *) source_image->bits();
+ unsigned char *pixels = source_image->bits();
// Loop through pixels
for (int pixel = 0, byte_index=0; pixel < source_image->width() * source_image->height(); pixel++, byte_index+=4)
@@ -1162,6 +1162,7 @@ void Clip::apply_keyframes(std::shared_ptr frame, int width, int height)
pixels[byte_index + 2] *= alpha_value;
pixels[byte_index + 3] *= alpha_value;
}
+ pixels = NULL;
// Debug output
ZmqLogger::Instance()->AppendDebugMethod("Clip::apply_keyframes (Set Alpha & Opacity)", "alpha_value", alpha_value, "frame->number", frame->number);
diff --git a/tests/FrameMapper_Tests.cpp b/tests/FrameMapper_Tests.cpp
index 54e76e64c..9caa2a18c 100644
--- a/tests/FrameMapper_Tests.cpp
+++ b/tests/FrameMapper_Tests.cpp
@@ -287,13 +287,8 @@ TEST(FrameMapper_AudioSample_Distribution)
c2.End(10.0);
// Add clips
-
t1.AddClip(&c1);
t1.AddClip(&c2);
-
- std::string json_val = t1.Json();
-
- //std::cout << json_val << std::endl;
//t1.SetJson(t1.Json());
t1.Open();