summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <[email protected]>2015-02-28 21:57:11 +0100
committerMichael Niedermayer <[email protected]>2015-02-28 21:57:11 +0100
commit5705dc527687fd84d94c934169b6bd753459744f (patch)
tree77cac834107115e21b3cacd708622d69bf87ba14
parent5f1ea0bfc53ac221abf312aeb79cb693f3a6e07d (diff)
avutil/imgutils: correctly check for negative SAR components
These could trigger assert failures previously Found-by: Andreas Cadhalpun <[email protected]> Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r--libavutil/imgutils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c
index 07b494c38a..a8bc18d025 100644
--- a/libavutil/imgutils.c
+++ b/libavutil/imgutils.c
@@ -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)