Changeset 8a967c6c765eae89f075369ff1147dd3cada32fb
- 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
| r18959e1 |
r8a967c6 |
|
| 39 | 39 | self->key=mediacontrol_MediaTime; |
|---|
| 40 | 40 | |
|---|
| 41 | | /* We do not care about the return value, since it will leave the fields |
|---|
| 42 | | with their default value. */ |
|---|
| 43 | 41 | if(! PyArg_ParseTupleAndKeywords( args, kwds, "|lii", kwlist, |
|---|
| 44 | 42 | &(self->value), |
|---|
| … | … | |
| 48 | 46 | return NULL; |
|---|
| 49 | 47 | } |
|---|
| 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 | |
|---|
| 51 | 65 | Py_INCREF( self ); |
|---|
| 52 | 66 | return ( PyObject * )self; |
|---|