diff options
author | Sybren A. Stüvel <sybren@stuvel.eu> | 2016-11-11 19:31:24 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@stuvel.eu> | 2016-11-11 19:31:24 +0300 |
commit | e3fd455d3293f7b8bd15491a3e0193002b648abf (patch) | |
tree | 0a2c94c89d927a26e9e78f67b246bd0126e938bd /source/blender/blenkernel/intern | |
parent | 9bf323b8ce9604dad7efe533a237b8a848a23d0f (diff) |
Somewhat gracefully handle frame index out of bound error.
@mont29 We should look at how we handle this properly; I think that the
printf() causes too much console noise.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/icons.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/icons.c b/source/blender/blenkernel/intern/icons.c index 838a732e387..7ba2eeefe8e 100644 --- a/source/blender/blenkernel/intern/icons.c +++ b/source/blender/blenkernel/intern/icons.c @@ -283,7 +283,12 @@ void BKE_previewimg_frame_delete(struct PreviewImage *prv, const short frame_idx unsigned int *BKE_previewimg_frame_data_get( const PreviewImage *prv, const unsigned short frame_idx, const enum eIconSizes size, int *r_meta) { - BLI_assert(prv != NULL && frame_idx < prv->num_frames); + BLI_assert(prv != NULL); + + if (frame_idx >= prv->num_frames) { + printf("BKE_previewimg_frame_data_get: requested frame %i of %i\n", frame_idx, prv->num_frames); + return NULL; + } unsigned int *frame = NULL; if (r_meta) { |