From d5c15ebeaf1914ea5e3e0599d4316d7c4cf74434 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 10 Jan 2014 21:32:05 +0100 Subject: hevc: Fix modulo operations Keep qp fields within the range. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Luca Barbato --- libavcodec/hevc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libavcodec/hevc.h') diff --git a/libavcodec/hevc.h b/libavcodec/hevc.h index 07d70739de..f623887c6e 100644 --- a/libavcodec/hevc.h +++ b/libavcodec/hevc.h @@ -85,6 +85,9 @@ s->nal_unit_type == NAL_BLA_N_LP) #define IS_IRAP(s) (s->nal_unit_type >= 16 && s->nal_unit_type <= 23) +#define FFUDIV(a,b) (((a) > 0 ? (a) : (a) - (b) + 1) / (b)) +#define FFUMOD(a,b) ((a) - (b) * FFUDIV(a,b)) + /** * Table 7-3: NAL unit type codes */ -- cgit v1.2.3