bin: fix size of dest memory.
authorJehan <jehan@girinstud.io>
Sat, 11 Feb 2023 15:53:42 +0000 (16:53 +0100)
committerJehan <jehan@girinstud.io>
Sat, 11 Feb 2023 16:30:10 +0000 (17:30 +0100)
I guess I was lucky I never got a crash for out-of-bound memory access.

bin/babl.c

index 964a3570cd4bf12b804e039502270337d400f319..4e1a6dcab249356ccaba243fb4f7b7a98e8da06f 100644 (file)
@@ -210,7 +210,7 @@ main (int    argc,
   data_index   = 0;
 
   to_format    = babl_format_with_space (to, to_space);
-  dest         = malloc (babl_format_get_bytes_per_pixel (from_format));
+  dest         = malloc (babl_format_get_bytes_per_pixel (to_format));
 
   /* Re-looping through arguments, to be more flexible with argument orders.
    * In this second loop, we get the source components' values.