projects
/
platform
/
upstream
/
gst-plugins-good.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
999d8be
)
rtpL16depay: don't crash if data is not modulo channels*width
author
Havard Graff
<havard.graff@gmail.com>
Wed, 30 Nov 2016 14:55:01 +0000
(15:55 +0100)
committer
Tim-Philipp Müller
<tim@centricular.com>
Mon, 2 Dec 2019 23:53:20 +0000
(23:53 +0000)
gst/rtp/gstrtpL16depay.c
patch
|
blob
|
history
diff --git
a/gst/rtp/gstrtpL16depay.c
b/gst/rtp/gstrtpL16depay.c
index
601f16e
..
3695da9
100644
(file)
--- a/
gst/rtp/gstrtpL16depay.c
+++ b/
gst/rtp/gstrtpL16depay.c
@@
-232,6
+232,7
@@
gst_rtp_L16_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
GstBuffer *outbuf;
gint payload_len;
gboolean marker;
GstBuffer *outbuf;
gint payload_len;
gboolean marker;
+ GstAudioInfo *info;
rtpL16depay = GST_RTP_L16_DEPAY (depayload);
rtpL16depay = GST_RTP_L16_DEPAY (depayload);
@@
-251,10
+252,15
@@
gst_rtp_L16_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
}
outbuf = gst_buffer_make_writable (outbuf);
}
outbuf = gst_buffer_make_writable (outbuf);
+ info = &rtpL16depay->info;
+
+ if (payload_len % info->bpf != 0)
+ goto wrong_payload_size;
+
if (rtpL16depay->order &&
!gst_audio_buffer_reorder_channels (outbuf,
if (rtpL16depay->order &&
!gst_audio_buffer_reorder_channels (outbuf,
-
rtpL16depay->info.finfo->format, rtpL16depay->info.
channels,
-
rtpL16depay->info.
position, rtpL16depay->order->pos)) {
+
info->finfo->format, info->
channels,
+
info->
position, rtpL16depay->order->pos)) {
goto reorder_failed;
}
goto reorder_failed;
}
@@
-269,6
+275,12
@@
empty_packet:
("Empty Payload."), (NULL));
return NULL;
}
("Empty Payload."), (NULL));
return NULL;
}
+wrong_payload_size:
+ {
+ GST_ELEMENT_WARNING (rtpL16depay, STREAM, DECODE,
+ ("Wrong Payload Size."), (NULL));
+ return NULL;
+ }
reorder_failed:
{
GST_ELEMENT_ERROR (rtpL16depay, STREAM, DECODE,
reorder_failed:
{
GST_ELEMENT_ERROR (rtpL16depay, STREAM, DECODE,