Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
mediastreamer2
Commits
49f3fb75
Commit
49f3fb75
authored
May 23, 2018
by
François Grisez
Browse files
Avoid crash while receiving an misformated FU header.
parent
0d0eb856
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
7 deletions
+15
-7
src/voip/h265-nal-unpacker.cpp
src/voip/h265-nal-unpacker.cpp
+3
-4
src/voip/nal-unpacker.cpp
src/voip/nal-unpacker.cpp
+12
-3
No files found.
src/voip/h265-nal-unpacker.cpp
View file @
49f3fb75
...
...
@@ -54,10 +54,7 @@ mblk_t *H265NalUnpacker::FuAggregator::feed(mblk_t *packet) {
}
if
(
fuHeader
.
getPosition
()
==
H265FuHeader
::
Position
::
End
)
{
mblk_t
*
m
=
_m
;
msgpullup
(
m
,
-
1
);
_m
=
nullptr
;
return
m
;
return
completeAggregation
();
}
else
return
nullptr
;
}
...
...
@@ -67,7 +64,9 @@ void H265NalUnpacker::FuAggregator::reset() {
}
mblk_t
*
H265NalUnpacker
::
FuAggregator
::
completeAggregation
()
{
if
(
!
isAggregating
())
return
nullptr
;
mblk_t
*
res
=
_m
;
msgpullup
(
res
,
-
1
);
_m
=
nullptr
;
return
res
;
}
...
...
src/voip/nal-unpacker.cpp
View file @
49f3fb75
...
...
@@ -18,7 +18,10 @@
*/
#include <bitset>
#include <stdexcept>
#include "mediastreamer2/msqueue.h"
#include "nal-unpacker.h"
using
namespace
std
;
...
...
@@ -87,9 +90,15 @@ NalUnpacker::Status NalUnpacker::unpack(mblk_t *im, MSQueue *out) {
storeNal
(
im
);
break
;
case
PacketType
::
FragmentationUnit
:
{
ms_debug
(
"Receiving FU-A"
);
mblk_t
*
o
=
_fuAggregator
->
feed
(
im
);
if
(
o
)
storeNal
(
o
);
try
{
ms_debug
(
"Receiving FU-A"
);
mblk_t
*
o
=
_fuAggregator
->
feed
(
im
);
if
(
o
)
storeNal
(
o
);
}
catch
(
const
invalid_argument
&
e
)
{
ms_error
(
"%s"
,
e
.
what
());
_fuAggregator
->
reset
();
_status
.
frameCorrupted
=
true
;
}
break
;
}
case
PacketType
::
AggregationPacket
:
...
...
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