diff options
author | Jeff Downs <heydowns@somuchpressure.net> | 2011-07-05 14:21:54 -0400 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-12-24 12:20:32 +0100 |
commit | 34d2fe68601ed21c2bda20f473ca800dfc980970 (patch) | |
tree | 0a2c39aa24da99bed01e3ab0d1cd104f9a893bb8 | |
parent | e7746f834a7b718f6459b08112bf0d6625362e42 (diff) | |
download | ffmpeg-34d2fe68601ed21c2bda20f473ca800dfc980970.tar.gz |
h264: correct the check for invalid long term frame index in MMCO decode
The current check 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.
Signed-off-by: Diego Biurrun <diego@biurrun.de>
(cherry picked from commit 29a09eae9a827f4dbc9c4517180d8fe2ecef321a)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/h264_refs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c index ed715c6b03..21c14d8d26 100644 --- a/libavcodec/h264_refs.c +++ b/libavcodec/h264_refs.c @@ -657,7 +657,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; } |