forked from apache/mxnet
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue apache#11912] throw mxnet exceptions when decoding invalid ima…
…ges. (apache#12999) * Raise an excption when passing an empty buffer to imdecode. * src/io/image_io.cc: Check the length of the input buffer. * tests/python/unittest/test_image.py: Update the (already existing) test to expect a mx.base.MXNetError. * Raise an exception when passing an invalid data buffer to imdecode. * src/io/image_io.cc: Raise an exception when the image could not be decoded instead of just logging. * tests/python/unittest/test_image.py: Add a new test test_imdecode_invalid_image. * Raise an exception when passing an invalid data buffer to imdecode. * src/io/image_io.cc: Raise an exception when the image could not be decoded instead of just logging. * tests/python/unittest/test_image.py: Add a new test test_imdecode_invalid_image. * Rollback a "empty buffer" check in the image python bindings that's now more generally handled in the core code. * python/mxnet/image/image.py: remove buffer length check.
- Loading branch information
Showing
3 changed files
with
10 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters