diff mbox series

[FFmpeg-devel,3/4] avformat/hlsenc: Fix mixed declaration and code

Message ID 20201020110334.197116-3-andreas.rheinhardt@gmail.com
State Accepted
Commit c4f65611bc14af6eb4a81416be51dca435548f82
Headers show
Series [FFmpeg-devel,1/4] avformat/hlsenc: Fix extradata length check | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Oct. 20, 2020, 11:03 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/hlsenc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Steven Liu Oct. 20, 2020, 11:24 a.m. UTC | #1
Andreas Rheinhardt <andreas.rheinhardt@gmail.com> 于2020年10月20日周二 下午7:04写道:
>
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavformat/hlsenc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index 22077073bd..4967247bca 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -352,13 +352,14 @@ static void write_codec_attr(AVStream *st, VariantStream *vs)
>          while (data && (data - st->codecpar->extradata + 19) < st->codecpar->extradata_size) {
>              /* get HEVC SPS NAL and seek to profile_tier_level */
>              if (!(data[0] | data[1] | data[2]) && data[3] == 1 && ((data[4] & 0x42) == 0x42)) {
> +                uint8_t *rbsp_buf;
>                  int remain_size = 0;
>                  int rbsp_size = 0;
>                  /* skip start code + nalu header */
>                  data += 6;
>                  /* process by reference General NAL unit syntax */
>                  remain_size = st->codecpar->extradata_size - (data - st->codecpar->extradata);
> -                uint8_t *rbsp_buf = ff_nal_unit_extract_rbsp(data, remain_size, &rbsp_size, 0);
> +                rbsp_buf = ff_nal_unit_extract_rbsp(data, remain_size, &rbsp_size, 0);
>                  if (!rbsp_buf)
>                      return;
>                  if (rbsp_size < 13) {
> --
> 2.25.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

lgtm

Thanks
Steven
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 22077073bd..4967247bca 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -352,13 +352,14 @@  static void write_codec_attr(AVStream *st, VariantStream *vs)
         while (data && (data - st->codecpar->extradata + 19) < st->codecpar->extradata_size) {
             /* get HEVC SPS NAL and seek to profile_tier_level */
             if (!(data[0] | data[1] | data[2]) && data[3] == 1 && ((data[4] & 0x42) == 0x42)) {
+                uint8_t *rbsp_buf;
                 int remain_size = 0;
                 int rbsp_size = 0;
                 /* skip start code + nalu header */
                 data += 6;
                 /* process by reference General NAL unit syntax */
                 remain_size = st->codecpar->extradata_size - (data - st->codecpar->extradata);
-                uint8_t *rbsp_buf = ff_nal_unit_extract_rbsp(data, remain_size, &rbsp_size, 0);
+                rbsp_buf = ff_nal_unit_extract_rbsp(data, remain_size, &rbsp_size, 0);
                 if (!rbsp_buf)
                     return;
                 if (rbsp_size < 13) {