Skip to content

Commit

Permalink
modified: CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jvo203 committed Feb 24, 2024
1 parent dc758f4 commit 8bb3bbb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 27 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [5.0.56] - 2024-03-??
## [5.0.56] - 2024-02-24

* set the ZeroMQ port to 0 by default, hence assuming a single-server mode (the port can be specified in the _*config.ini*_ file)
* corrected the P-V Diagram line length calculation inside a FORTRAN subroutine, added capacity checks to prevent potential out-of-bounds accesses

## [5.0.55] - 2024-02-22

Expand Down
17 changes: 0 additions & 17 deletions Julia/pv_line.jl

This file was deleted.

22 changes: 14 additions & 8 deletions src/fits.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8679,7 +8679,7 @@ recursive subroutine ws_pv_request(user) BIND(C, name='ws_pv_request')
type(c_ptr) :: pid
integer(kind=c_int) :: rc

integer :: frame, first, last, length, npoints, i, j, max_threads
integer :: frame, first, last, length, capacity, npoints, i, j, max_threads
real :: dx, dy, dp, t, dt
integer(c_int) :: x1, x2, y1, y2
integer :: prev_x, prev_y, cur_x, cur_y
Expand Down Expand Up @@ -8762,8 +8762,8 @@ recursive subroutine ws_pv_request(user) BIND(C, name='ws_pv_request')
print *, 'dx:', dx, 'dy:', dy, 'dp:', dp, 'dt:', dt

! over-allocate the points array
npoints = ceiling(2*dp)
allocate (points(2,npoints))
capacity = ceiling(2*dp)
allocate (points(2,capacity))

! first enumerate points along the line
npoints = 0
Expand All @@ -8781,9 +8781,12 @@ recursive subroutine ws_pv_request(user) BIND(C, name='ws_pv_request')
end if

t = t + dt

! break the loop if capacity is exceeded
if (npoints .ge. capacity) exit
end do

print *, 'npoints:', npoints
print *, 'npoints:', npoints, 'capacity:', capacity

! there will be at least one point
! allocate the pv array using an appropriate astronomical orientation convention
Expand Down Expand Up @@ -8980,7 +8983,7 @@ subroutine get_pv_diagram(item, req, pixels, width, height, pmin, pmax, pmean, p
type(c_ptr) :: pid
integer(kind=c_int) :: rc

integer :: frame, first, last, length, i, j, max_threads
integer :: frame, first, last, length, i, j, max_threads, capacity
real :: dx, dy, dp, t, dt
integer(c_int) :: x1, x2, y1, y2
integer :: prev_x, prev_y, cur_x, cur_y
Expand Down Expand Up @@ -9039,8 +9042,8 @@ subroutine get_pv_diagram(item, req, pixels, width, height, pmin, pmax, pmean, p
print *, 'dx:', dx, 'dy:', dy, 'dp:', dp, 'dt:', dt

! over-allocate the points array
npoints = ceiling(2*dp)
allocate (points(2,npoints))
capacity = ceiling(2*dp)
allocate (points(2,capacity))

! first enumerate points along the line
npoints = 0
Expand All @@ -9058,9 +9061,12 @@ subroutine get_pv_diagram(item, req, pixels, width, height, pmin, pmax, pmean, p
end if

t = t + dt

! break the loop if capacity is exceeded
if (npoints .ge. capacity) exit
end do

print *, 'npoints:', npoints
print *, 'npoints:', npoints, 'capacity:', capacity

! there will be at least one point
! allocate the pv array using an appropriate astronomical orientation convention
Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#define VERSION_MAJOR 5
#define VERSION_MINOR 0
#define VERSION_SUB 55
#define VERSION_SUB 56

#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
Expand Down

0 comments on commit 8bb3bbb

Please sign in to comment.