movie::frame_subframes: Gracefully handle invalid frame numbers

Doesn't fix cache invalidation errors tho.
This commit is contained in:
Ilari Liusvaara 2015-07-04 12:18:11 +03:00
parent 6d1a67719b
commit d8048863e8

View file

@ -308,6 +308,8 @@ size_t movie::restore_state(uint64_t curframe, uint64_t lagframe, const std::vec
uint64_t movie::frame_subframes(uint64_t frame) throw()
{
if(!frame) return 0;
if(frame > movie_data->size()) return 0;
if(frame < cached_frame)
clear_caches();
uint64_t p = cached_subframe;