Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
GSoC
GSoC2018
macOS
vlc
Commits
1d47f9e6
Commit
1d47f9e6
authored
Sep 09, 2005
by
Christophe Mutricy
Browse files
Fix a possible segfault patch by Brian Robb
parent
18dc9cc4
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/extras/libc.c
View file @
1d47f9e6
...
...
@@ -29,6 +29,7 @@
#include <ctype.h>
#include <vlc/vlc.h>
#include <vlc_common.h>
#undef iconv_t
#undef iconv_open
...
...
@@ -612,7 +613,14 @@ size_t vlc_iconv( vlc_iconv_t cd, char **inbuf, size_t *inbytesleft,
#if defined(HAVE_ICONV)
return
iconv
(
cd
,
inbuf
,
inbytesleft
,
outbuf
,
outbytesleft
);
#else
int
i_bytes
=
__MIN
(
*
inbytesleft
,
*
outbytesleft
);
int
i_bytes
;
if
(
inbytesleft
==
NULL
||
outbytesleft
==
NULL
)
{
return
0
;
}
i_bytes
=
__MIN
(
*
inbytesleft
,
*
outbytesleft
);
if
(
!
inbuf
||
!
outbuf
||
!
i_bytes
)
return
(
size_t
)(
-
1
);
memcpy
(
*
outbuf
,
*
inbuf
,
i_bytes
);
inbuf
+=
i_bytes
;
...
...
Write
Preview
Supports
Markdown
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