rtmp2: Reject oversized messages

We only have 24 bits for the size, so reject anything larger.
This commit is contained in:
Jan Alexander Steffens (heftig) 2020-02-14 12:20:32 +01:00 committed by GStreamer Merge Bot
parent 0044e7a1ba
commit 6583e00d50
2 changed files with 4 additions and 0 deletions

View file

@ -188,6 +188,8 @@ select_chunk_type (GstRtmpChunkStream * cstream, GstBuffer * buffer)
meta->size = gst_buffer_get_size (buffer);
meta->cstream = cstream->id;
g_return_val_if_fail (meta->size <= GST_RTMP_MAXIMUM_MESSAGE_SIZE, -1);
if (!old_buffer) {
GST_TRACE ("Picking header 0: no previous header");
meta->ts_delta = dts_to_abs_ts (buffer);

View file

@ -25,6 +25,8 @@
G_BEGIN_DECLS
#define GST_RTMP_MAXIMUM_MESSAGE_SIZE 0xFFFFFF
typedef enum {
GST_RTMP_MESSAGE_TYPE_INVALID = 0,
GST_RTMP_MESSAGE_TYPE_SET_CHUNK_SIZE = 1,