X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fjpeg2000.h;h=8a022ad9188a8c1a3b20975267a4833f1e7ab132;hb=2d025e742843ca3532bd49ebbfebeacd51337347;hp=ed3b421ad8111cc046671c1f9b4f564d8bced23e;hpb=52a4004d8b5f308b3fc83e825dcd9052332eaeef;p=ffmpeg diff --git a/libavcodec/jpeg2000.h b/libavcodec/jpeg2000.h index ed3b421ad81..8a022ad9188 100644 --- a/libavcodec/jpeg2000.h +++ b/libavcodec/jpeg2000.h @@ -215,12 +215,12 @@ typedef struct Jpeg2000Component { /* misc tools */ static inline int ff_jpeg2000_ceildivpow2(int a, int b) { - return -(((int64_t)(-a)) >> b); + return -((-(int64_t)a) >> b); } static inline int ff_jpeg2000_ceildiv(int a, int b) { - return (a + b - 1) / b; + return (a + (int64_t)b - 1) / b; } /* TIER-1 routines */