diff mbox series

[FFmpeg-devel,2/4] avformat/hlsenc: Don't use uninitialized buffer in av_stristr()

Message ID 20201020110334.197116-2-andreas.rheinhardt@gmail.com
State Accepted
Commit 1ba174f461bab97d4e9d0d81f43d788afeae6639
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
Introduced in a2b1dd0ce301450a47c972745a6b33c4c273aa5d.

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:25 a.m. UTC | #1
Andreas Rheinhardt <andreas.rheinhardt@gmail.com> 于2020年10月20日周二 下午7:04写道:
>
> Introduced in a2b1dd0ce301450a47c972745a6b33c4c273aa5d.
>
> 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 49c4ab5966..22077073bd 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -380,7 +380,8 @@ static void write_codec_attr(AVStream *st, VariantStream *vs)
>              profile != FF_PROFILE_UNKNOWN &&
>              level != FF_LEVEL_UNKNOWN) {
>              snprintf(attr, sizeof(attr), "%s.%d.4.L%d.B01", av_fourcc2str(st->codecpar->codec_tag), profile, level);
> -        }
> +        } else
> +            goto fail;
>      } else if (st->codecpar->codec_id == AV_CODEC_ID_MP2) {
>          snprintf(attr, sizeof(attr), "mp4a.40.33");
>      } else if (st->codecpar->codec_id == AV_CODEC_ID_MP3) {
> --
> 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 49c4ab5966..22077073bd 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -380,7 +380,8 @@  static void write_codec_attr(AVStream *st, VariantStream *vs)
             profile != FF_PROFILE_UNKNOWN &&
             level != FF_LEVEL_UNKNOWN) {
             snprintf(attr, sizeof(attr), "%s.%d.4.L%d.B01", av_fourcc2str(st->codecpar->codec_tag), profile, level);
-        }
+        } else
+            goto fail;
     } else if (st->codecpar->codec_id == AV_CODEC_ID_MP2) {
         snprintf(attr, sizeof(attr), "mp4a.40.33");
     } else if (st->codecpar->codec_id == AV_CODEC_ID_MP3) {