Show
Ignore:
Timestamp:
05/21/15 16:11:54 (20 hours ago)
Author:
robert
Message:

Fixed memory error associated with reading over the end of container due to an unbounded while loop.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgimagesequence/osgimagesequence.cpp

    r12292 r13085  
    7070    while (arguments.read("--length",length)) {} 
    7171     
     72    double fps = 30.0; 
     73    while (arguments.read("--fps",fps)) {} 
     74 
    7275    if (arguments.argc()>1) 
    7376    { 
     
    8790            } 
    8891        } 
     92 
    8993         
    9094        if (length>0.0) 
     
    97101                                               imageSequence->getImages().size()); 
    98102                                                
    99             imageSequence->setLength(float(maxNum)*0.1f); 
     103            imageSequence->setLength(double(maxNum)*(1.0/fps)); 
    100104        } 
    101105    }