Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
8a967c6c
Commit
8a967c6c
authored
May 29, 2007
by
Olivier Aubert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
python bindings, vlc_position.c: check against invalid origin or key values
parent
5d4b0529
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
3 deletions
+17
-3
bindings/python/vlc_position.c
bindings/python/vlc_position.c
+17
-3
No files found.
bindings/python/vlc_position.c
View file @
8a967c6c
...
@@ -38,8 +38,6 @@ PyPosition_new( PyTypeObject *type, PyObject *args, PyObject *kwds )
...
@@ -38,8 +38,6 @@ PyPosition_new( PyTypeObject *type, PyObject *args, PyObject *kwds )
self
->
origin
=
mediacontrol_AbsolutePosition
;
self
->
origin
=
mediacontrol_AbsolutePosition
;
self
->
key
=
mediacontrol_MediaTime
;
self
->
key
=
mediacontrol_MediaTime
;
/* We do not care about the return value, since it will leave the fields
with their default value. */
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"|lii"
,
kwlist
,
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwds
,
"|lii"
,
kwlist
,
&
(
self
->
value
),
&
(
self
->
value
),
&
(
self
->
origin
),
&
(
self
->
origin
),
...
@@ -47,7 +45,23 @@ PyPosition_new( PyTypeObject *type, PyObject *args, PyObject *kwds )
...
@@ -47,7 +45,23 @@ PyPosition_new( PyTypeObject *type, PyObject *args, PyObject *kwds )
{
{
return
NULL
;
return
NULL
;
}
}
if
(
self
->
key
!=
mediacontrol_MediaTime
&&
self
->
key
!=
mediacontrol_ByteCount
&&
self
->
key
!=
mediacontrol_SampleCount
)
{
PyErr_SetString
(
MediaControl_InternalException
,
"Invalid key value"
);
return
NULL
;
}
if
(
self
->
origin
!=
mediacontrol_AbsolutePosition
&&
self
->
origin
!=
mediacontrol_RelativePosition
&&
self
->
origin
!=
mediacontrol_ModuloPosition
)
{
PyErr_SetString
(
MediaControl_InternalException
,
"Invalid origin value"
);
return
NULL
;
}
Py_INCREF
(
self
);
Py_INCREF
(
self
);
return
(
PyObject
*
)
self
;
return
(
PyObject
*
)
self
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment