]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/apedec.c
avcodec/mobiclip: Check that Motion vectors are within the input frame
[ffmpeg] / libavcodec / apedec.c
index aa4d8fa5242d22be397efb25ddac32f5ee28af86..8fe7b5ee86feca4425f2dbebf95b55d9bb78878e 100644 (file)
@@ -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);