mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
lavu/opt: check int lists length for overflow.
Also add parens on macro arguments.
This commit is contained in:
parent
2a1d7ea5f8
commit
9e8e03de38
@ -668,8 +668,10 @@ int av_opt_set_video_rate(void *obj, const char *name, AVRational val, int searc
|
|||||||
* @param flags search flags
|
* @param flags search flags
|
||||||
*/
|
*/
|
||||||
#define av_opt_set_int_list(obj, name, val, term, flags) \
|
#define av_opt_set_int_list(obj, name, val, term, flags) \
|
||||||
av_opt_set_bin(obj, name, (const uint8_t *)val, \
|
(av_int_list_length(val, term) > INT_MAX / sizeof(*(val)) ? \
|
||||||
av_int_list_length(val, term) * sizeof(*val), flags)
|
AVERROR(EINVAL) : \
|
||||||
|
av_opt_set_bin(obj, name, (const uint8_t *)(val), \
|
||||||
|
av_int_list_length(val, term) * sizeof(*(val)), flags))
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user