flacdec: simplify bounds checking in flac_probe()
authorXi Wang <xi.wang@gmail.com>
Fri, 15 Mar 2013 11:11:47 +0000 (07:11 -0400)
committerLuca Barbato <lu_zero@gentoo.org>
Fri, 15 Mar 2013 12:33:35 +0000 (13:33 +0100)
commitd8010bda7a233fbfa05c3d7690d717a86102926c
tree7460c738d5a7a1a79ff6490b5d06b9ab367ddd09
parent12d8ae297911c3020f4d3c1c34967a47b30fb8aa
flacdec: simplify bounds checking in flac_probe()

Simplify `p->buf > p->buf + p->buf_size - 4' as `p->buf_size < 4'.
Avoid a possible out-of-bounds pointer, which is undefined behavior
in C.

CC: libav-stable@libav.org
Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
(cherry picked from commit 8425d693eefbedbb41f91735614d41067695aa37)
libavformat/flacdec.c