summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 0ed57a26c1..0f756a2b74 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1559,9 +1559,8 @@ again:
h->valid_recovery_point = 1;
if ( h->recovery_frame < 0
- || ((h->recovery_frame - h->frame_num) & ((1 << h->sps.log2_max_frame_num)-1)) > h->sei_recovery_frame_cnt) {
- h->recovery_frame = (h->frame_num + h->sei_recovery_frame_cnt) &
- ((1 << h->sps.log2_max_frame_num) - 1);
+ || av_mod_uintp2(h->recovery_frame - h->frame_num, h->sps.log2_max_frame_num) > h->sei_recovery_frame_cnt) {
+ h->recovery_frame = av_mod_uintp2(h->frame_num + h->sei_recovery_frame_cnt, h->sps.log2_max_frame_num);
if (!h->valid_recovery_point)
h->recovery_frame = h->frame_num;