Re: [libav-devel] [PATCH 2/4] h264: correct the check for invalid long term frame index in MMCO decode

2011-08-16 Thread Ronald S. Bultje
Hi,

On Tue, Aug 16, 2011 at 8:05 AM, Diego Biurrun  wrote:
> From: Jeff Downs 
>
> 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 
> ---
>  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 b7e43e7..12e3b94 100644
> --- a/libavcodec/h264_refs.c
> +++ b/libavcodec/h264_refs.c
> @@ -685,7 +685,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))){

I believe Alexander (Strange) said this change was OK.

Ronald
___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel


[libav-devel] [PATCH 2/4] h264: correct the check for invalid long term frame index in MMCO decode

2011-08-16 Thread Diego Biurrun
From: Jeff Downs 

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 
---
 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 b7e43e7..12e3b94 100644
--- a/libavcodec/h264_refs.c
+++ b/libavcodec/h264_refs.c
@@ -685,7 +685,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;
 }
-- 
1.7.1

___
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel