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
7eaca895
Commit
7eaca895
authored
May 22, 2008
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check malloc return value when needed and don't print an error when such error happend.
Fix a potential segfault.
parent
fa781f22
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
11 additions
and
58 deletions
+11
-58
modules/video_output/aa.c
modules/video_output/aa.c
+0
-3
modules/video_output/caca.c
modules/video_output/caca.c
+0
-3
modules/video_output/directfb.c
modules/video_output/directfb.c
+0
-3
modules/video_output/fb.c
modules/video_output/fb.c
+0
-5
modules/video_output/ggi.c
modules/video_output/ggi.c
+0
-3
modules/video_output/glide.c
modules/video_output/glide.c
+0
-3
modules/video_output/hd1000v.cpp
modules/video_output/hd1000v.cpp
+1
-4
modules/video_output/image.c
modules/video_output/image.c
+3
-0
modules/video_output/mga.c
modules/video_output/mga.c
+0
-3
modules/video_output/msw/direct3d.c
modules/video_output/msw/direct3d.c
+0
-3
modules/video_output/msw/directx.c
modules/video_output/msw/directx.c
+0
-3
modules/video_output/msw/events.c
modules/video_output/msw/events.c
+6
-3
modules/video_output/msw/glwin32.c
modules/video_output/msw/glwin32.c
+0
-3
modules/video_output/opengl.c
modules/video_output/opengl.c
+1
-10
modules/video_output/qte/qte.cpp
modules/video_output/qte/qte.cpp
+0
-3
modules/video_output/x11/xcommon.c
modules/video_output/x11/xcommon.c
+0
-6
No files found.
modules/video_output/aa.c
View file @
7eaca895
...
...
@@ -90,10 +90,7 @@ static int Create( vlc_object_t *p_this )
/* Allocate structure */
p_vout
->
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
(
1
);
}
/* Don't parse any options, but take $AAOPTS into account */
aa_parseoptions
(
NULL
,
NULL
,
NULL
,
NULL
);
...
...
modules/video_output/caca.c
View file @
7eaca895
...
...
@@ -163,10 +163,7 @@ static int Create( vlc_object_t *p_this )
/* Allocate structure */
p_vout
->
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
VLC_ENOMEM
;
}
p_vout
->
p_sys
->
p_cv
=
cucul_create_canvas
(
0
,
0
);
if
(
!
p_vout
->
p_sys
->
p_cv
)
...
...
modules/video_output/directfb.c
View file @
7eaca895
...
...
@@ -89,10 +89,7 @@ static int Create( vlc_object_t *p_this )
/* Allocate structure */
p_vout
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
!
p_sys
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
VLC_ENOMEM
;
}
p_sys
->
p_directfb
=
NULL
;
p_sys
->
p_primary
=
NULL
;
...
...
modules/video_output/fb.c
View file @
7eaca895
...
...
@@ -186,10 +186,7 @@ static int Create( vlc_object_t *p_this )
/* Allocate instance and initialize some members */
p_vout
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
VLC_ENOMEM
;
};
memset
(
p_sys
,
0
,
sizeof
(
vout_sys_t
)
);
p_vout
->
pf_init
=
Init
;
...
...
@@ -874,8 +871,6 @@ static int OpenDisplay( vout_thread_t *p_vout )
p_sys
->
p_palette
=
malloc
(
8
*
256
*
sizeof
(
uint16_t
)
);
if
(
!
p_sys
->
p_palette
)
{
msg_Err
(
p_vout
,
"out of memory"
);
/* Restore fb config */
ioctl
(
p_sys
->
i_fd
,
FBIOPUT_VSCREENINFO
,
&
p_sys
->
old_info
);
...
...
modules/video_output/ggi.c
View file @
7eaca895
...
...
@@ -104,10 +104,7 @@ static int Create( vlc_object_t *p_this )
/* Allocate structure */
p_vout
->
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
(
1
);
}
/* Open and initialize device */
if
(
OpenDisplay
(
p_vout
)
)
...
...
modules/video_output/glide.c
View file @
7eaca895
...
...
@@ -96,10 +96,7 @@ static int Create( vlc_object_t *p_this )
/* Allocate structure */
p_vout
->
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
(
1
);
}
/* Open and initialize device */
if
(
OpenDisplay
(
p_vout
)
)
...
...
modules/video_output/hd1000v.cpp
View file @
7eaca895
...
...
@@ -97,10 +97,7 @@ static int Create( vlc_object_t *p_this )
p_vout
->
p_sys
=
(
struct
vout_sys_t
*
)
malloc
(
sizeof
(
struct
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
VLC_EGENERIC
;
}
return
VLC_ENOMEM
;
/* Allocate a screen for VLC vout. */
p_vout
->
p_sys
->
p_screen
=
new
CascadeScreen
();
...
...
modules/video_output/image.c
View file @
7eaca895
...
...
@@ -315,6 +315,9 @@ static void Display( vout_thread_t *p_vout, picture_t *p_pic )
psz_prefix
=
psz_tmp
;
psz_filename
=
(
char
*
)
malloc
(
10
+
strlen
(
psz_prefix
)
+
strlen
(
p_vout
->
p_sys
->
psz_format
)
);
if
(
!
psz_filename
)
return
;
if
(
p_vout
->
p_sys
->
b_replace
)
{
sprintf
(
psz_filename
,
"%s.%s"
,
psz_prefix
,
...
...
modules/video_output/mga.c
View file @
7eaca895
...
...
@@ -137,10 +137,7 @@ static int Create( vlc_object_t *p_this )
/* Allocate structure */
p_vout
->
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
(
1
);
}
p_vout
->
p_sys
->
i_fd
=
open
(
"/dev/mga_vid"
,
O_RDWR
);
if
(
p_vout
->
p_sys
->
i_fd
==
-
1
)
...
...
modules/video_output/msw/direct3d.c
View file @
7eaca895
...
...
@@ -153,10 +153,7 @@ static int OpenVideo( vlc_object_t *p_this )
/* Allocate structure */
p_vout
->
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
VLC_ENOMEM
;
}
memset
(
p_vout
->
p_sys
,
0
,
sizeof
(
vout_sys_t
)
);
if
(
VLC_SUCCESS
!=
Direct3DVoutCreate
(
p_vout
)
)
...
...
modules/video_output/msw/directx.c
View file @
7eaca895
...
...
@@ -210,10 +210,7 @@ static int OpenVideo( vlc_object_t *p_this )
/* Allocate structure */
p_vout
->
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
VLC_ENOMEM
;
}
memset
(
p_vout
->
p_sys
,
0
,
sizeof
(
vout_sys_t
)
);
/* Initialisations */
...
...
modules/video_output/msw/events.c
View file @
7eaca895
...
...
@@ -343,9 +343,12 @@ void EventThread( event_thread_t *p_event )
#ifdef UNICODE
{
wchar_t
*
psz_title
=
malloc
(
strlen
(
val
.
psz_string
)
*
2
+
2
);
mbstowcs
(
psz_title
,
val
.
psz_string
,
strlen
(
val
.
psz_string
)
*
2
);
psz_title
[
strlen
(
val
.
psz_string
)]
=
0
;
free
(
val
.
psz_string
);
val
.
psz_string
=
(
char
*
)
psz_title
;
if
(
psz_title
)
{
mbstowcs
(
psz_title
,
val
.
psz_string
,
strlen
(
val
.
psz_string
)
*
2
);
psz_title
[
strlen
(
val
.
psz_string
)]
=
0
;
free
(
val
.
psz_string
);
val
.
psz_string
=
(
char
*
)
psz_title
;
}
}
#endif
...
...
modules/video_output/msw/glwin32.c
View file @
7eaca895
...
...
@@ -96,10 +96,7 @@ static int OpenVideo( vlc_object_t *p_this )
/* Allocate structure */
p_vout
->
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
VLC_ENOMEM
;
}
memset
(
p_vout
->
p_sys
,
0
,
sizeof
(
vout_sys_t
)
);
/* Initialisations */
...
...
modules/video_output/opengl.c
View file @
7eaca895
...
...
@@ -250,10 +250,7 @@ static int CreateVout( vlc_object_t *p_this )
/* Allocate structure */
p_vout
->
p_sys
=
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
VLC_EGENERIC
;
}
return
VLC_ENOMEM
;
var_Create
(
p_vout
,
"opengl-effect"
,
VLC_VAR_STRING
|
VLC_VAR_DOINHERIT
);
...
...
@@ -409,17 +406,11 @@ static int Init( vout_thread_t *p_vout )
p_sys
->
pp_buffer
[
0
]
=
malloc
(
p_sys
->
i_tex_width
*
p_sys
->
i_tex_height
*
i_pixel_pitch
);
if
(
!
p_sys
->
pp_buffer
[
0
]
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
-
1
;
}
p_sys
->
pp_buffer
[
1
]
=
malloc
(
p_sys
->
i_tex_width
*
p_sys
->
i_tex_height
*
i_pixel_pitch
);
if
(
!
p_sys
->
pp_buffer
[
1
]
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
-
1
;
}
p_vout
->
p_picture
[
0
].
i_planes
=
1
;
p_vout
->
p_picture
[
0
].
p
->
p_pixels
=
p_sys
->
pp_buffer
[
0
];
...
...
modules/video_output/qte/qte.cpp
View file @
7eaca895
...
...
@@ -143,10 +143,7 @@ static int Open( vlc_object_t *p_this )
p_vout
->
p_sys
=
(
struct
vout_sys_t
*
)
malloc
(
sizeof
(
struct
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
(
1
);
}
p_vout
->
pf_init
=
Init
;
p_vout
->
pf_end
=
End
;
...
...
modules/video_output/x11/xcommon.c
View file @
7eaca895
...
...
@@ -206,10 +206,7 @@ int Activate ( vlc_object_t *p_this )
/* Allocate structure */
p_vout
->
p_sys
=
malloc
(
sizeof
(
vout_sys_t
)
);
if
(
p_vout
->
p_sys
==
NULL
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
VLC_ENOMEM
;
}
vlc_mutex_init
(
&
p_vout
->
p_sys
->
lock
);
...
...
@@ -2942,10 +2939,7 @@ static IMAGE_TYPE * CreateImage( vout_thread_t *p_vout,
p_data
=
malloc
(
i_bytes_per_line
*
i_height
);
#endif
if
(
!
p_data
)
{
msg_Err
(
p_vout
,
"out of memory"
);
return
NULL
;
}
#ifdef MODULE_NAME_IS_x11
/* Optimize the quantum of a scanline regarding its size - the quantum is
...
...
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