summaryrefslogtreecommitdiffstats
path: root/libhb/common.h
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-04-16 01:11:53 +0000
committerjstebbins <[email protected]>2011-04-16 01:11:53 +0000
commitf7cf2757ca1839b131d153e1a50029c2ed10f8b1 (patch)
tree54bfc657e745b3e3ffa907288aee469fd3f0be42 /libhb/common.h
parent61460ce74a948d7ba36240fbc9fb658168c2f834 (diff)
Fix int overflow that can happen when computing PAR
If the source has large non-reduced PAR values, our computed value was overflowing an int. Compute it in an int64_t then reduce it. Also, keep num and den below 65535. Larger values just aren't really significant and will cause more overflow issues. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3931 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/common.h')
-rw-r--r--libhb/common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/libhb/common.h b/libhb/common.h
index bb0c219cb..b945200e7 100644
--- a/libhb/common.h
+++ b/libhb/common.h
@@ -91,6 +91,8 @@ void * hb_list_item( hb_list_t *, int );
void hb_list_close( hb_list_t ** );
void hb_reduce( int *x, int *y, int num, int den );
+void hb_reduce64( int64_t *x, int64_t *y, int64_t num, int64_t den );
+void hb_limit_rational64( int64_t *x, int64_t *y, int64_t num, int64_t den, int64_t limit );
#define HB_KEEP_WIDTH 0
#define HB_KEEP_HEIGHT 1