Skip to content

Commit 84166e8

Browse files
committed
Fix unhandled exception when getting the HDU data fails (typically in the case of the file being truncated; see astropy/astropy#541)
git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@2265 ed100bfc-0583-0410-97f2-c26b58777a21
1 parent 9159e65 commit 84166e8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎src/compressionmodule.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -988,6 +988,9 @@ PyObject* compression_decompress_hdu(PyObject* self, PyObject* args)
988988
// Grab a pointer to the input data from the HDU's compressed_data
989989
// attribute
990990
get_hdu_data_base(hdu, &inbuf, &inbufsize);
991+
if (PyErr_Occurred()) {
992+
return NULL;
993+
}
991994

992995
open_from_hdu(&fileptr, &inbuf, &inbufsize, hdu, &columns);
993996
if (PyErr_Occurred()) {

0 commit comments

Comments
 (0)