Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
e587a428
Commit
e587a428
authored
Sep 11, 2014
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/rtpproto: fix strict aliasing violations with sockaddr
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
8c1dc1f6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
rtpproto.c
libavformat/rtpproto.c
+7
-4
No files found.
libavformat/rtpproto.c
View file @
e587a428
...
...
@@ -130,23 +130,26 @@ static int compare_addr(const struct sockaddr_storage *a,
static
int
get_port
(
const
struct
sockaddr_storage
*
ss
)
{
sockaddr_union
ssu
=
(
sockaddr_union
){.
storage
=
*
ss
};
if
(
ss
->
ss_family
==
AF_INET
)
return
ntohs
(
((
const
struct
sockaddr_in
*
)
ss
)
->
sin_port
);
return
ntohs
(
ssu
.
in
.
sin_port
);
#if HAVE_STRUCT_SOCKADDR_IN6
if
(
ss
->
ss_family
==
AF_INET6
)
return
ntohs
(
((
const
struct
sockaddr_in6
*
)
ss
)
->
sin6_port
);
return
ntohs
(
ssu
.
in6
.
sin6_port
);
#endif
return
0
;
}
static
void
set_port
(
struct
sockaddr_storage
*
ss
,
int
port
)
{
sockaddr_union
ssu
=
(
sockaddr_union
){.
storage
=
*
ss
};
if
(
ss
->
ss_family
==
AF_INET
)
((
struct
sockaddr_in
*
)
ss
)
->
sin_port
=
htons
(
port
);
ssu
.
in
.
sin_port
=
htons
(
port
);
#if HAVE_STRUCT_SOCKADDR_IN6
else
if
(
ss
->
ss_family
==
AF_INET6
)
((
struct
sockaddr_in6
*
)
ss
)
->
sin6_port
=
htons
(
port
);
ssu
.
in6
.
sin6_port
=
htons
(
port
);
#endif
*
ss
=
ssu
.
storage
;
}
static
int
rtp_check_source_lists
(
RTPContext
*
s
,
struct
sockaddr_storage
*
source_addr_ptr
)
...
...
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