mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-11 18:09:36 +00:00
avutil/imgutils: correctly check for negative SAR components
These could trigger assert failures previously
Found-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 5705dc5276
)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
eceea69567
commit
d42540499c
@ -245,7 +245,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar)
|
||||
{
|
||||
int64_t scaled_dim;
|
||||
|
||||
if (!sar.den)
|
||||
if (sar.den <= 0 || sar.num < 0)
|
||||
return AVERROR(EINVAL);
|
||||
|
||||
if (!sar.num || sar.num == sar.den)
|
||||
|
Loading…
Reference in New Issue
Block a user