avpacket: fix size check in packet_alloc
authorAndreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Tue, 5 Jan 2016 12:05:50 +0000 (13:05 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 7 Jan 2016 07:20:21 +0000 (08:20 +0100)
commitfa463aa83a4920b0eed47ad1f79775dfc53d21ec
tree4a32cb244b819c4041020a20f67d9c6c4004f184
parent066281372d90d63ca021b659abcb8faefd6bc4a6
avpacket: fix size check in packet_alloc

The previous check only caught sizes from -AV_INPUT_BUFFER_PADDING_SIZE
to -1.

This fixes ubsan runtime error: signed integer overflow: 2147483647 + 32
cannot be represented in type 'int'

Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/avpacket.c