From 9c5ec7df3cd0168cb92e1983e680fc030f94a543 Mon Sep 17 00:00:00 2001 From: Aang23 Date: Wed, 28 Jun 2023 22:50:42 +0200 Subject: [PATCH] Prevent crash on 0 channel --- src-interface/viewer/image_handler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src-interface/viewer/image_handler.cpp b/src-interface/viewer/image_handler.cpp index d7fafa78c..656cb4ab1 100644 --- a/src-interface/viewer/image_handler.cpp +++ b/src-interface/viewer/image_handler.cpp @@ -54,8 +54,11 @@ namespace satdump } scale_view.update(scale_image); scale_view.allow_zoom_and_move = false; - correction_factors = generate_horizontal_corr_lut(*products, products->images[0].image.width()); - correction_factors.push_back(products->images[0].image.width()); + if (products->images.size() > 0) + { + correction_factors = generate_horizontal_corr_lut(*products, products->images[0].image.width()); + correction_factors.push_back(products->images[0].image.width()); + } // font current_image.init_font(resources::getResourcePath("fonts/font.ttf"));