summaryrefslogtreecommitdiff
path: root/libavcodec/h264_refs.c
diff options
context:
space:
mode:
authorJeff Downs <heydowns@somuchpressure.net>2011-07-05 14:21:54 -0400
committerJeff Downs <heydowns@somuchpressure.net>2011-07-28 15:11:16 -0400
commite80e2d5ba1d8c699fa1cf0c329feb6e237362505 (patch)
tree0dcb2b244c03d4b32871ca7cd4a743cbc20c74ae /libavcodec/h264_refs.c
parent188694b2f50b125b31cf5d287751ee85af937c2b (diff)
h264 - correct the check for invalid long term frame index in MMCO decode
The current checks on MMCO parameters prohibits a "max long term frame index plus 1" of 16 (frame idx of 15) for the "set max long term frame index" MMCO. Fix this off-by-one error to allow the full range of legal values.
Diffstat (limited to 'libavcodec/h264_refs.c')
-rw-r--r--libavcodec/h264_refs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
index 2c952537e3..6794bf3c9f 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -680,7 +680,7 @@ int ff_h264_decode_ref_pic_marking(H264Context *h, GetBitContext *gb){
}
if(opcode==MMCO_SHORT2LONG || opcode==MMCO_LONG2UNUSED || opcode==MMCO_LONG || opcode==MMCO_SET_MAX_LONG){
unsigned int long_arg= get_ue_golomb_31(gb);
- if(long_arg >= 32 || (long_arg >= 16 && !(opcode == MMCO_LONG2UNUSED && FIELD_PICTURE))){
+ if(long_arg >= 32 || (long_arg >= 16 && !(opcode == MMCO_SET_MAX_LONG && long_arg == 16) && !(opcode == MMCO_LONG2UNUSED && FIELD_PICTURE))){
av_log(h->s.avctx, AV_LOG_ERROR, "illegal long ref in memory management control operation %d\n", opcode);
return -1;
}