summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec_h261.c
diff options
context:
space:
mode:
authorThomas Volkert <thomas@homer-conferencing.com>2014-11-01 13:01:53 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-01 16:33:52 +0100
commit8d9277c3c01c24616532f05a5a09c8bfc7387010 (patch)
treef4b556244511ecf57b7ecdbb4a21a5af50f48022 /libavformat/rtpdec_h261.c
parent46353759cb3c90ad8eb4af6526c236513d477296 (diff)
downloadffmpeg-8d9277c3c01c24616532f05a5a09c8bfc7387010.tar.gz
avformat/rtpdec_h261: code aligned to the HEVC code
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/rtpdec_h261.c')
-rw-r--r--libavformat/rtpdec_h261.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/libavformat/rtpdec_h261.c b/libavformat/rtpdec_h261.c
index b902d2aa40..43244bb43d 100644
--- a/libavformat/rtpdec_h261.c
+++ b/libavformat/rtpdec_h261.c
@@ -32,7 +32,7 @@ struct PayloadContext {
uint32_t timestamp;
};
-static PayloadContext *h261_new_context(void)
+static av_cold PayloadContext *h261_new_context(void)
{
return av_mallocz(sizeof(PayloadContext));
}
@@ -45,7 +45,7 @@ static void h261_free_dyn_buffer(AVIOContext **dyn_buf)
*dyn_buf = NULL;
}
-static void h261_free_context(PayloadContext *pl_ctx)
+static av_cold void h261_free_context(PayloadContext *pl_ctx)
{
/* return if context is invalid */
if (!pl_ctx)
@@ -80,16 +80,14 @@ int ff_h261_handle_packet(AVFormatContext *ctx, PayloadContext *data,
int sbit, ebit, gobn, mbap, quant;
int res;
- //av_log(ctx, AV_LOG_DEBUG, "got h261 RTP packet with time: %u\n", timestamp);
-
/* drop data of previous packets in case of non-continuous (loss) packet stream */
if (data->buf && data->timestamp != *timestamp) {
h261_free_dyn_buffer(&data->buf);
}
- /* sanity check for size of input packet */
- if (len < 5 /* 4 bytes header and 1 byte payload at least */) {
- av_log(ctx, AV_LOG_ERROR, "Too short H.261 RTP packet\n");
+ /* sanity check for size of input packet: 1 byte payload at least */
+ if (len < RTP_H261_PAYLOAD_HEADER_SIZE + 1) {
+ av_log(ctx, AV_LOG_ERROR, "Too short RTP/H.261 packet, got %d bytes\n", len);
return AVERROR_INVALIDDATA;
}