summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSimon Farnsworth <simon.farnsworth@onelan.co.uk>2008-07-28 17:14:41 +0100
committerSimon Farnsworth <simon.farnsworth@onelan.co.uk>2008-07-28 17:14:41 +0100
commita5d25b426a852306d74c4e4ecf39b1e3de289945 (patch)
treeeab98f4d85a335d8622275415e25f0d2ca3cb89e /src
parenta9cbcc9a321b8baaf71b9a19d2b8ffde4390c6f9 (diff)
downloadxine-lib-a5d25b426a852306d74c4e4ecf39b1e3de289945.tar.gz
xine-lib-a5d25b426a852306d74c4e4ecf39b1e3de289945.tar.bz2
Preallocate after we know how large the frames will be (fixes a buffer overrun)
Diffstat (limited to 'src')
-rw-r--r--src/input/input_v4l.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c
index 00c579c44..9e6b783e3 100644
--- a/src/input/input_v4l.c
+++ b/src/input/input_v4l.c
@@ -892,10 +892,6 @@ static int open_video_capture_device(v4l_input_plugin_t *this)
_x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_AUDIO, 1);
_x_stream_info_set(this->stream, XINE_STREAM_INFO_HAS_VIDEO, 1);
- /* Pre-allocate some frames for audio and video so it doesn't have to be
- * done during capture */
- allocate_frames(this, 1);
-
/* Unmute audio off video capture device */
unmute_audio(this);
@@ -1004,7 +1000,11 @@ static int open_video_capture_device(v4l_input_plugin_t *this)
xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_X, 103);
xine_set_param(this->stream, XINE_PARAM_VO_ZOOM_Y, 103);
-
+
+ /* Pre-allocate some frames for audio and video so it doesn't have to be
+ * done during capture */
+ allocate_frames(this, 1);
+
/* If we made it here, everything went ok */
this->audio_only = 0;
if (tuner_found)