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
1684a6ae
Commit
1684a6ae
authored
Mar 23, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed dvbsi_to_utf8 (memory leak + possible segfault)
parent
042f53c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
modules/access/dvb/en50221.c
modules/access/dvb/en50221.c
+10
-4
No files found.
modules/access/dvb/en50221.c
View file @
1684a6ae
...
...
@@ -2309,6 +2309,12 @@ void E_(en50221_End)( access_t * p_access )
* program. */
}
static
inline
void
*
FixUTF8
(
char
*
p
)
{
EnsureUTF8
(
p
);
return
p
;
}
static
char
*
dvbsi_to_utf8
(
char
*
psz_instring
,
size_t
i_length
)
{
const
char
*
psz_encoding
;
...
...
@@ -2317,7 +2323,7 @@ static char *dvbsi_to_utf8( char *psz_instring, size_t i_length )
size_t
i_in
,
i_out
;
vlc_iconv_t
iconv_handle
;
if
(
i_length
<
1
)
return
NULL
;
if
(
psz_instring
[
0
]
>=
0x20
)
if
(
psz_instring
[
0
]
<
0
||
psz_instring
[
0
]
>=
0x20
)
{
psz_stringstart
=
psz_instring
;
psz_encoding
=
"ISO_8859-1"
;
/* should be ISO6937 according to spec, but this seems to be the one used */
...
...
@@ -2370,7 +2376,7 @@ static char *dvbsi_to_utf8( char *psz_instring, size_t i_length )
case
0x10
:
if
(
i_length
<
3
||
psz_instring
[
1
]
!=
'\0'
||
psz_instring
[
2
]
>
0x0f
||
psz_instring
[
2
]
==
0
)
return
Ensure
UTF8
(
strndup
(
psz_instring
,
i_length
));
return
Fix
UTF8
(
strndup
(
psz_instring
,
i_length
));
sprintf
(
psz_encbuf
,
"ISO_8859-%d"
,
psz_instring
[
2
]
);
psz_stringstart
=
&
psz_instring
[
3
];
psz_encoding
=
psz_encbuf
;
...
...
@@ -2392,11 +2398,11 @@ static char *dvbsi_to_utf8( char *psz_instring, size_t i_length )
psz_encoding
=
"BIG-5"
;
break
;
case
0x15
:
return
Ensure
UTF8
(
strndup
(
&
psz_instring
[
1
],
i_length
-
1
));
return
Fix
UTF8
(
strndup
(
&
psz_instring
[
1
],
i_length
-
1
));
break
;
default:
/* invalid */
return
Ensure
UTF8
(
strndup
(
psz_instring
,
i_length
));
return
Fix
UTF8
(
strndup
(
psz_instring
,
i_length
));
}
iconv_handle
=
vlc_iconv_open
(
"UTF-8"
,
psz_encoding
);
i_in
=
i_length
-
(
psz_stringstart
-
psz_instring
);
...
...
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