c
int value = atoi(optarg);
if (value == 0 && optarg[0] != '0') {
    handle_invalid_input_error();
}
if (value < INT_MIN || value > INT_MAX) {
    handle_out_of_range_error();
}
horizSubSampling = value;

// Custom error handling functions
void handle_invalid_input_error() {
    // Handle error: input string is not a valid integer
}

void handle_out_of_range_error() {
    // Handle error: input value is outside the range of int
}
