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>
Wed, 23 Jan 2013 04:29:59 +0000 (05:29 +0100)
commit4e692374f7962ea358c329de38c380103f8991b6
treeaf414e7a6330378374eb0036c777998924c19eb6
parent902cfe2f74d777a7dc20ac68f2393b9f84b790c1
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>
libavformat/rtmppkt.c