There is a floating point exception in ReadImage that leads to a Segmentation fault in sam2p 0.49.4. A crafted input will lead to a denial of service or possibly unspecified other impact.
https://github.com/pts/sam2p/issues/66
https://github.com/pts/sam2p/commit/b953f63307c4a83fa4615a4863e3fb250205cd98