Changeset 8a967c6c765eae89f075369ff1147dd3cada32fb

Show
Ignore:
Timestamp:
05/29/07 12:01:36 (1 year ago)
Author:
Olivier Aubert <olivier.aubert@liris.cnrs.fr>
git-committer:
Olivier Aubert <olivier.aubert@liris.cnrs.fr> 1180432896 +0000
git-parent:

[5d4b052965b669062a42fa905887921c1c07b342]

git-author:
Olivier Aubert <olivier.aubert@liris.cnrs.fr> 1180432896 +0000
Message:

python bindings, vlc_position.c: check against invalid origin or key values

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bindings/python/vlc_position.c

    r18959e1 r8a967c6  
    3939    self->key=mediacontrol_MediaTime; 
    4040 
    41     /* We do not care about the return value, since it will leave the fields 
    42        with their default value. */ 
    4341    if(! PyArg_ParseTupleAndKeywords( args, kwds, "|lii", kwlist, 
    4442                                      &(self->value), 
     
    4846        return NULL;         
    4947    } 
    50         
     48 
     49    if( self->key != mediacontrol_MediaTime  
     50    && self->key != mediacontrol_ByteCount 
     51    && self->key != mediacontrol_SampleCount )  
     52    { 
     53        PyErr_SetString ( MediaControl_InternalException, "Invalid key value" ); 
     54        return NULL; 
     55    } 
     56 
     57    if( self->origin != mediacontrol_AbsolutePosition  
     58    && self->origin != mediacontrol_RelativePosition 
     59    && self->origin != mediacontrol_ModuloPosition )  
     60    { 
     61        PyErr_SetString ( MediaControl_InternalException, "Invalid origin value" ); 
     62        return NULL; 
     63    } 
     64 
    5165    Py_INCREF( self ); 
    5266    return ( PyObject * )self;