Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
209f2eaf
Commit
209f2eaf
authored
Jun 25, 2003
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* transcode: fix a potential segfault.
parent
6691d5b2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
150 additions
and
137 deletions
+150
-137
modules/stream_out/transcode.c
modules/stream_out/transcode.c
+150
-137
No files found.
modules/stream_out/transcode.c
View file @
209f2eaf
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* transcode.c
* transcode.c
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN
* Copyright (C) 2001, 2002 VideoLAN
* $Id: transcode.c,v 1.1
7 2003/05/22 20:45:25 hartman
Exp $
* $Id: transcode.c,v 1.1
8 2003/06/25 21:47:05 fenrir
Exp $
*
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
*
...
@@ -601,15 +601,15 @@ static int transcode_audio_ffmpeg_new ( sout_stream_t *p_stream, sout_stream_i
...
@@ -601,15 +601,15 @@ static int transcode_audio_ffmpeg_new ( sout_stream_t *p_stream, sout_stream_i
}
}
id
->
i_buffer_in
=
AVCODEC_MAX_AUDIO_FRAME_SIZE
;
id
->
i_buffer_in
=
2
*
AVCODEC_MAX_AUDIO_FRAME_SIZE
;
id
->
i_buffer_in_pos
=
0
;
id
->
i_buffer_in_pos
=
0
;
id
->
p_buffer_in
=
malloc
(
id
->
i_buffer_in
);
id
->
p_buffer_in
=
malloc
(
id
->
i_buffer_in
);
id
->
i_buffer
=
AVCODEC_MAX_AUDIO_FRAME_SIZE
;
id
->
i_buffer
=
2
*
AVCODEC_MAX_AUDIO_FRAME_SIZE
;
id
->
i_buffer_pos
=
0
;
id
->
i_buffer_pos
=
0
;
id
->
p_buffer
=
malloc
(
id
->
i_buffer
);
id
->
p_buffer
=
malloc
(
id
->
i_buffer
);
id
->
i_buffer_out
=
AVCODEC_MAX_AUDIO_FRAME_SIZE
;
id
->
i_buffer_out
=
2
*
AVCODEC_MAX_AUDIO_FRAME_SIZE
;
id
->
i_buffer_out_pos
=
0
;
id
->
i_buffer_out_pos
=
0
;
id
->
p_buffer_out
=
malloc
(
id
->
i_buffer_out
);
id
->
p_buffer_out
=
malloc
(
id
->
i_buffer_out
);
...
@@ -635,6 +635,8 @@ static void transcode_audio_ffmpeg_close ( sout_stream_t *p_stream, sout_stream_
...
@@ -635,6 +635,8 @@ static void transcode_audio_ffmpeg_close ( sout_stream_t *p_stream, sout_stream_
static
int
transcode_audio_ffmpeg_process
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
,
static
int
transcode_audio_ffmpeg_process
(
sout_stream_t
*
p_stream
,
sout_stream_id_t
*
id
,
sout_buffer_t
*
in
,
sout_buffer_t
**
out
)
sout_buffer_t
*
in
,
sout_buffer_t
**
out
)
{
{
vlc_bool_t
b_again
=
VLC_FALSE
;
*
out
=
NULL
;
*
out
=
NULL
;
/* gather data into p_buffer_in */
/* gather data into p_buffer_in */
...
@@ -654,6 +656,8 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, sout_stream_
...
@@ -654,6 +656,8 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, sout_stream_
in
->
i_size
);
in
->
i_size
);
id
->
i_buffer_in_pos
+=
in
->
i_size
;
id
->
i_buffer_in_pos
+=
in
->
i_size
;
do
{
/* decode as many data as possible */
/* decode as many data as possible */
if
(
id
->
ff_dec
)
if
(
id
->
ff_dec
)
{
{
...
@@ -689,6 +693,13 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, sout_stream_
...
@@ -689,6 +693,13 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, sout_stream_
id
->
i_buffer_in_pos
=
0
;
id
->
i_buffer_in_pos
=
0
;
break
;
break
;
}
}
if
(
id
->
i_buffer_pos
>=
AVCODEC_MAX_AUDIO_FRAME_SIZE
)
{
/* buffer full */
b_again
=
VLC_TRUE
;
break
;
}
}
}
}
}
else
else
...
@@ -813,6 +824,8 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, sout_stream_
...
@@ -813,6 +824,8 @@ static int transcode_audio_ffmpeg_process( sout_stream_t *p_stream, sout_stream_
sout_BufferChain
(
out
,
p_out
);
sout_BufferChain
(
out
,
p_out
);
}
}
}
while
(
b_again
);
return
VLC_SUCCESS
;
return
VLC_SUCCESS
;
}
}
...
...
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