summaryrefslogtreecommitdiff
path: root/rotord/rotor.cpp
diff options
context:
space:
mode:
authorTim Redfern <tim@eclectronics.org>2013-06-14 20:33:21 +0100
committerTim Redfern <tim@eclectronics.org>2013-06-14 20:33:21 +0100
commitb438fa8772d071663692c6c936881e1f44590523 (patch)
treeadc46d1bc14f0294d28e2e9217aa12a4b694e139 /rotord/rotor.cpp
parent2dd01db2ace9c2356f2e2419e4065e9994b74a65 (diff)
weird bugs with small files
Diffstat (limited to 'rotord/rotor.cpp')
-rwxr-xr-xrotord/rotor.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp
index 2fa5183..37af5a1 100755
--- a/rotord/rotor.cpp
+++ b/rotord/rotor.cpp
@@ -377,12 +377,14 @@ Image* Video_loader::output(const Frame_spec &frame){
*/
if (isLoaded){
- int wanted=((int) (frame.time*frame.framerate))%(player.getNumberOfFrames()-2); //-2??
- if (!player.fetchFrame(frame.w,frame.h,wanted)) { cerr<<"Rotor: frame returned false"<<endl; };
+ int wanted=((int) (frame.time*frame.framerate))%(player.getNumberOfFrames()); //-2?? this would give division by zero
+ if (!player.fetchFrame(frame.w,frame.h,wanted)) { cerr<<"Rotor: frame returned false"<<endl; return nullptr; };
image.setup_fromRGB(frame.w,frame.h,player.pFrameRGB->data[0]);
return &image;
}
+ //confusingly, crashes with files not made with ffmpeg/ short files?
+
return nullptr;
};