diff mbox series

[FFmpeg-devel,3/4] avcodec/apedec: use proper macro and type for pivot variable

Message ID 20201006001714.19577-3-onemda@gmail.com
State Accepted
Commit 2fb517855a5c6dc623b59d5a5e342cc668aa220d
Headers show
Series [FFmpeg-devel,1/4] avcodec/apedec: fix decoding insane files with recent versions | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Paul B Mahol Oct. 6, 2020, 12:17 a.m. UTC
Signed-off-by: Paul B Mahol <onemda@gmail.com>
---
 libavcodec/apedec.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c
index aa4d8fa524..8fe7b5ee86 100644
--- a/libavcodec/apedec.c
+++ b/libavcodec/apedec.c
@@ -559,12 +559,10 @@  static inline int ape_decode_value_3900(APEContext *ctx, APERice *rice)
 
 static inline int ape_decode_value_3990(APEContext *ctx, APERice *rice)
 {
-    unsigned int x, overflow;
-    int base, pivot;
+    unsigned int x, overflow, pivot;
+    int base;
 
-    pivot = rice->ksum >> 5;
-    if (pivot == 0)
-        pivot = 1;
+    pivot = FFMAX(rice->ksum >> 5, 1);
 
     overflow = range_get_symbol(ctx, counts_3980, counts_diff_3980);