X-Git-Url: https://git.piment-noir.org/?p=deb_ffmpeg.git;a=blobdiff_plain;f=ffmpeg%2Flibavformat%2Frtpdec_h261.c;fp=ffmpeg%2Flibavformat%2Frtpdec_h261.c;h=43244bb43ddedc24a418a433f309cad4abf26f5a;hp=b902d2aa4082c60a435ffe0fcb6c36da94191ec5;hb=f6fa7814ccfe3e76514b36cf04f5cd3cb657c8cf;hpb=2ba45a602cbfa7b771effba9b11bb4245c21bc00 diff --git a/ffmpeg/libavformat/rtpdec_h261.c b/ffmpeg/libavformat/rtpdec_h261.c index b902d2a..43244bb 100644 --- a/ffmpeg/libavformat/rtpdec_h261.c +++ b/ffmpeg/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; }