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
cf77bbb0
Commit
cf77bbb0
authored
Jan 15, 2014
by
Francois Cartegnie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
encoder: dirac: fix heap overflow
parent
9fc1397a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
modules/codec/dirac.c
modules/codec/dirac.c
+21
-3
No files found.
modules/codec/dirac.c
View file @
cf77bbb0
...
...
@@ -41,6 +41,7 @@
#include <vlc_plugin.h>
#include <vlc_codec.h>
#include <vlc_sout.h>
#include <vlc_picture.h>
#include <libdirac_encoder/dirac_encoder.h>
...
...
@@ -519,19 +520,16 @@ static int OpenEncoder( vlc_object_t *p_this )
p_enc
->
fmt_in
.
i_codec
=
VLC_CODEC_I420
;
p_enc
->
fmt_in
.
video
.
i_bits_per_pixel
=
12
;
p_sys
->
ctx
.
src_params
.
chroma
=
format420
;
p_sys
->
i_buffer_in
=
p_enc
->
fmt_in
.
video
.
i_visible_width
*
p_enc
->
fmt_in
.
video
.
i_visible_height
*
3
/
2
;
}
else
if
(
!
strcmp
(
psz_tmp
,
"422"
)
)
{
p_enc
->
fmt_in
.
i_codec
=
VLC_CODEC_I422
;
p_enc
->
fmt_in
.
video
.
i_bits_per_pixel
=
16
;
p_sys
->
ctx
.
src_params
.
chroma
=
format422
;
p_sys
->
i_buffer_in
=
p_enc
->
fmt_in
.
video
.
i_visible_width
*
p_enc
->
fmt_in
.
video
.
i_visible_height
*
2
;
}
else
if
(
!
strcmp
(
psz_tmp
,
"444"
)
)
{
p_enc
->
fmt_in
.
i_codec
=
VLC_CODEC_I444
;
p_enc
->
fmt_in
.
video
.
i_bits_per_pixel
=
24
;
p_sys
->
ctx
.
src_params
.
chroma
=
format444
;
p_sys
->
i_buffer_in
=
p_enc
->
fmt_in
.
video
.
i_visible_width
*
p_enc
->
fmt_in
.
video
.
i_visible_height
*
3
;
}
else
{
msg_Err
(
p_enc
,
"Invalid chroma format: %s"
,
psz_tmp
);
...
...
@@ -540,6 +538,26 @@ static int OpenEncoder( vlc_object_t *p_this )
}
free
(
psz_tmp
);
picture_t
picture
;
picture_Setup
(
&
picture
,
p_enc
->
fmt_in
.
i_codec
,
p_enc
->
fmt_in
.
video
.
i_width
,
p_enc
->
fmt_in
.
video
.
i_height
,
p_enc
->
fmt_in
.
video
.
i_sar_num
,
p_enc
->
fmt_in
.
video
.
i_sar_den
);
switch
(
p_enc
->
fmt_in
.
i_codec
)
{
case
VLC_CODEC_I420
:
p_sys
->
i_buffer_in
=
picture
.
format
.
i_visible_width
*
picture
.
format
.
i_visible_height
*
3
/
2
;
break
;
case
VLC_CODEC_I422
:
p_sys
->
i_buffer_in
=
picture
.
format
.
i_visible_width
*
picture
.
format
.
i_visible_height
*
2
;
break
;
case
VLC_CODEC_I444
:
p_sys
->
i_buffer_in
=
picture
.
format
.
i_visible_width
*
picture
.
format
.
i_visible_height
*
3
;
break
;
}
p_sys
->
ctx
.
enc_params
.
qf
=
var_GetFloat
(
p_enc
,
ENC_CFG_PREFIX
ENC_QUALITY_FACTOR
);
/* use bitrate from sout-transcode-vb in kbps */
...
...
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