On Wednesday, July 31, 2013, Martin Storsjö wrote:

> I doubt that anyone ever would try to send a 1 byte packet
> via the RTP protocol, but check just in case - it shouldn't
> crash at least.
> ---
>  libavformat/rtpproto.c |    3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/libavformat/rtpproto.c b/libavformat/rtpproto.c
> index b4475ae..974aa35 100644
> --- a/libavformat/rtpproto.c
> +++ b/libavformat/rtpproto.c
> @@ -377,6 +377,9 @@ static int rtp_write(URLContext *h, const uint8_t
> *buf, int size)
>      int ret;
>      URLContext *hd;
>
> +    if (size < 2)
> +        return AVERROR(EINVAL);
> +
>      if (RTP_PT_IS_RTCP(buf[1])) {
>          /* RTCP payload type */
>          hd = s->rtcp_hd;



Looks ok.
Vittorio
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to