diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-10 21:32:05 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-01-21 11:57:43 +0100 |
commit | d5c15ebeaf1914ea5e3e0599d4316d7c4cf74434 (patch) | |
tree | 9bcc7137c1cc71b0e6819b5bbed0607de9457eaa /libavcodec/hevc.h | |
parent | a7a07cc98ac548297b5b0628cb81280e11952e3f (diff) | |
download | ffmpeg-d5c15ebeaf1914ea5e3e0599d4316d7c4cf74434.tar.gz |
hevc: Fix modulo operations
Keep qp fields within the range.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Diffstat (limited to 'libavcodec/hevc.h')
-rw-r--r-- | libavcodec/hevc.h | 3 |
1 files changed, 3 insertions, 0 deletions
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 */ |