[13/14] cbs_h264: Need [] in the name when subscript is required

Message ID 20190504121427.9638-14-lu_zero@gentoo.org
State New
Headers show
Series
  • [01/14] maint: Ignore dot dirs
Related show

Commit Message

Luca Barbato May 4, 2019, 12:14 p.m.
From: Haihao Xiang <haihao.xiang@intel.com>

Otherwise it will hit an assert in the function
ff_cbs_trace_syntax_element() in cbs.c, line 400.

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavcodec/cbs_h264_syntax_template.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Alexandra Hájková May 13, 2019, 8:56 a.m. | #1
On Sat, May 4, 2019 at 2:15 PM Luca Barbato <lu_zero@gentoo.org> wrote:
>
> From: Haihao Xiang <haihao.xiang@intel.com>
>
> Otherwise it will hit an assert in the function
> ff_cbs_trace_syntax_element() in cbs.c, line 400.
>
> Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
> ---
>  libavcodec/cbs_h264_syntax_template.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c
> index 35ff85f653..28840f0bfe 100644
> --- a/libavcodec/cbs_h264_syntax_template.c
> +++ b/libavcodec/cbs_h264_syntax_template.c
> @@ -763,7 +763,7 @@ static int FUNC(sei_payload)(CodedBitstreamContext *ctx, RWContext *rw,
>          {
>              allocate(current->payload.other.data, current->payload_size);
>              for (i = 0; i < current->payload_size; i++)
> -                xu(8, payload_byte, current->payload.other.data[i], 0, 255, 1, i);
> +                xu(8, payload_byte[i], current->payload.other.data[i], 0, 255, 1, i);
>          }
>      }
>
> --
> 2.12.2
>
> _______________________________________________
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel

OK

Patch

diff --git a/libavcodec/cbs_h264_syntax_template.c b/libavcodec/cbs_h264_syntax_template.c
index 35ff85f653..28840f0bfe 100644
--- a/libavcodec/cbs_h264_syntax_template.c
+++ b/libavcodec/cbs_h264_syntax_template.c
@@ -763,7 +763,7 @@  static int FUNC(sei_payload)(CodedBitstreamContext *ctx, RWContext *rw,
         {
             allocate(current->payload.other.data, current->payload_size);
             for (i = 0; i < current->payload_size; i++)
-                xu(8, payload_byte, current->payload.other.data[i], 0, 255, 1, i);
+                xu(8, payload_byte[i], current->payload.other.data[i], 0, 255, 1, i);
         }
     }