Commit 5705dc52 authored by Michael Niedermayer's avatar Michael Niedermayer

avutil/imgutils: correctly check for negative SAR components

These could trigger assert failures previously
Found-by: 's avatarAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 5f1ea0bf
...@@ -245,7 +245,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar) ...@@ -245,7 +245,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar)
{ {
int64_t scaled_dim; int64_t scaled_dim;
if (!sar.den) if (sar.den <= 0 || sar.num < 0)
return AVERROR(EINVAL); return AVERROR(EINVAL);
if (!sar.num || sar.num == sar.den) if (!sar.num || sar.num == sar.den)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment