Commit eb57e494 authored by Luca Barbato's avatar Luca Barbato Committed by Luca Barbato

Prevent Pixel vs bit_depth mismatch

parent 157b353c
...@@ -447,6 +447,8 @@ const MAX_USABLE_THREADS: usize = 4; ...@@ -447,6 +447,8 @@ const MAX_USABLE_THREADS: usize = 4;
impl Config { impl Config {
pub fn new_context<T: Pixel>(&self) -> Context<T> { pub fn new_context<T: Pixel>(&self) -> Context<T> {
assert!(8 * std::mem::size_of::<T>() >= self.enc.bit_depth, "The Pixel u{} does not match the Config bit_depth {}",
8 * std::mem::size_of::<T>(), self.enc.bit_depth);
// initialize with temporal delimiter // initialize with temporal delimiter
let packet_data = TEMPORAL_DELIMITER.to_vec(); let packet_data = TEMPORAL_DELIMITER.to_vec();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment