diff --git a/examples/src/50-shadertoy/main.cpp b/examples/src/50-shadertoy/main.cpp
index cae845118c6b89f5f47800a3e9d16142cf583842..def76039ad6debfecbc742c0718cd5fa64657a8f 100644
--- a/examples/src/50-shadertoy/main.cpp
+++ b/examples/src/50-shadertoy/main.cpp
@@ -101,7 +101,9 @@ int render(GLFWwindow* window, shadertoy::context_config &contextConfig, bool du
 				u::log::shadertoy()->info("Dumping {} to {}", bufferConfig.first, dumpPath);
 
 				std::ofstream ofs(dumpPath.string());
-				auto dump(shadertoy::utils::dump_program(context.buffer(bufferConfig.first)->program()));
+				auto dump(shadertoy::utils::dump_program(
+							std::static_pointer_cast<shadertoy::toy_buffer>(context.buffer(bufferConfig.first))
+							->program()));
 				ofs.write(dump.data(), dump.size());
 				ofs.close();
 			}