[segyio] 50/376: Check possible stride computation error

Jørgen Kvalsvik jokva-guest at moszumanska.debian.org
Wed Sep 20 08:04:06 UTC 2017


This is an automated email from the git hooks/post-receive script.

jokva-guest pushed a commit to branch debian
in repository segyio.

commit cd48ce2eb6a5c0b528ce0341b49ffa9548821736
Author: Jørgen Kvalsvik <jokva at statoil.com>
Date:   Tue Oct 18 16:50:13 2016 +0200

    Check possible stride computation error
---
 python/segyio/_segyio.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/python/segyio/_segyio.c b/python/segyio/_segyio.c
index 05dbfab..83a347b 100644
--- a/python/segyio/_segyio.c
+++ b/python/segyio/_segyio.c
@@ -448,7 +448,9 @@ static PyObject *py_init_line_metrics(PyObject *self, PyObject *args) {
     unsigned int xline_length = segy_crossline_length(inline_count);
 
     unsigned int iline_stride;
-    segy_inline_stride(sorting, inline_count, &iline_stride);
+    int error = segy_inline_stride(sorting, inline_count, &iline_stride);
+    //Only check first call since the only error that can occur is SEGY_INVALID_SORTING
+    if( error ) { return py_handle_segy_error( error, errno ); }
 
     unsigned int xline_stride;
     segy_crossline_stride(sorting, crossline_count, &xline_stride);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/segyio.git



More information about the debian-science-commits mailing list