summaryrefslogtreecommitdiff
path: root/libavcodec/h264.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-31 22:15:45 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-01-01 21:43:43 +0100
commitfba6777363eb74d926aa0eed281a77ff152a3ad5 (patch)
treeb31ee1c8b3f4bee6c4372fa01f5ee0ddcbacb3a7 /libavcodec/h264.c
parent36fa781bd6b4e0f40abd31431af2d29d87e9b194 (diff)
h264: Fix recovery_frame initialization when recovery_frame is -1
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/h264.c')
-rw-r--r--libavcodec/h264.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index b0c5049483..27240e00d9 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3896,7 +3896,8 @@ static int decode_nal_units(H264Context *h, const uint8_t *buf, int buf_size){
break;
if ( h->sei_recovery_frame_cnt >= 0
- && ((h->recovery_frame - h->frame_num) & ((1 << h->sps.log2_max_frame_num)-1)) > h->sei_recovery_frame_cnt) {
+ && ( 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);
}