avcodec/adpcm: fix signed integer overflow in get_nb_samples()
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 4 Jun 2026 19:42:47 +0000 (21:42 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 18 Jun 2026 18:31:01 +0000 (20:31 +0200)
commitbd18424bb0dfaee29578c4a751e966316b29b4ac
tree5fa6111d1c2fcd64fe2679940b0c558c2a850792
parent23f2446387c09b5ae57461709d0bb8db637bf872
avcodec/adpcm: fix signed integer overflow in get_nb_samples()

Fixes: signed integer overflow: 314572800 * 8 cannot be represented in type 'int'

Tighten the guard to INT_MAX/14, which covers the largest expansion
factor used in the function currently.

Found-by: Jiale Yao <19888972804@163.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 04e2341056bc6f280d93810fd000e057bee0d3a4)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/adpcm.c