rtmp: fix buffer overflows in ff_amf_tag_contents()
authorXi Wang <xi.wang@gmail.com>
Wed, 23 Jan 2013 02:40:05 +0000 (21:40 -0500)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 14 Feb 2013 14:18:23 +0000 (15:18 +0100)
commitef953f760ef1b616574cabf2a3e9580b7bf21ac4
treec0812d3efe06be5d3782738c05b30991d27df46f
parent69b3fedc09d93ddf8041a5383435e7f4943ceadc
rtmp: fix buffer overflows in ff_amf_tag_contents()

A negative `size' will bypass FFMIN().  In the subsequent memcpy() call,
`size' will be considered as a large positive value, leading to a buffer
overflow.

Change the type of `size' to unsigned int to avoid buffer overflow, and
simplify overflow checks accordingly.

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 4e692374f7962ea358c329de38c380103f8991b6)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/rtmppkt.c