avpacket: fix size check in packet_alloc
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Tue, 5 Jan 2016 12:01:53 +0000 (13:01 +0100)
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Tue, 5 Jan 2016 21:30:50 +0000 (22:30 +0100)
commitda3c3c446cb434be9d0025f519e00c2385135c85
treef4e19a0499e85a2ac1046df39b521cd6ef2160f6
parentfa74cdc60d19798c951dcc242ca7273e6483f2b3
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'

Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
libavcodec/avpacket.c