diff options
| author | Tim Redfern <tim@eclectronics.org> | 2013-06-14 20:33:21 +0100 |
|---|---|---|
| committer | Tim Redfern <tim@eclectronics.org> | 2013-06-14 20:33:21 +0100 |
| commit | b438fa8772d071663692c6c936881e1f44590523 (patch) | |
| tree | adc46d1bc14f0294d28e2e9217aa12a4b694e139 /rotord/rotor.cpp | |
| parent | 2dd01db2ace9c2356f2e2419e4065e9994b74a65 (diff) | |
weird bugs with small files
Diffstat (limited to 'rotord/rotor.cpp')
| -rwxr-xr-x | rotord/rotor.cpp | 6 |
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 ℑ } + //confusingly, crashes with files not made with ffmpeg/ short files? + return nullptr; }; |
