]> git.sesse.net Git - ffmpeg/commitdiff
atrac9dec: relax gradient value requirements
authorRostislav Pehlivanov <atomnuker@gmail.com>
Mon, 27 Aug 2018 22:12:36 +0000 (23:12 +0100)
committerRostislav Pehlivanov <atomnuker@gmail.com>
Mon, 27 Aug 2018 22:18:03 +0000 (23:18 +0100)
Unlike the range, the gradient start value does not have to be lower
than the end value.
Does allow more files to be correctly decoded without errors.

Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
libavcodec/atrac9dec.c

index 629757f63d76f30bc69c5f7f76c92c7514a0954d..28f8fef174d6f681b795d9383d952c301ad6cf43 100644 (file)
@@ -123,7 +123,7 @@ static inline int parse_gradient(ATRAC9Context *s, ATRAC9BlockData *b,
     if (grad_range[0] >= grad_range[1] || grad_range[1] > 47)
         return AVERROR_INVALIDDATA;
 
-    if (grad_value[0] >= grad_value[1] || grad_value[1] >= 32)
+    if (grad_value[0] > 31 || grad_value[1] > 31)
         return AVERROR_INVALIDDATA;
 
     if (b->grad_boundary > b->q_unit_cnt)