smoothstreamingenc: Add a missing "goto fail"

Message ID 1421267330-45976-1-git-send-email-martin@martin.st
State Committed
Commit ea3fc9fe68752eb1b9078b28bea18a1e781d1c2c
Headers show

Commit Message

Martin Storsjö Jan. 14, 2015, 8:28 p.m.
From: Michael Niedermayer <michaelni@gmx.at>

This goto wasn't necessary originally, but adding it was missed
when the write_manifest call was added in 8e276378.

CC: libav-stable@libav.org
---
 libavformat/smoothstreamingenc.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Anton Khirnov Jan. 19, 2015, 12:05 p.m. | #1
Quoting Martin Storsjö (2015-01-14 21:28:50)
> From: Michael Niedermayer <michaelni@gmx.at>
> 
> This goto wasn't necessary originally, but adding it was missed
> when the write_manifest call was added in 8e276378.
> 
> CC: libav-stable@libav.org
> ---
>  libavformat/smoothstreamingenc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
> index ddd8da7..1db2dba 100644
> --- a/libavformat/smoothstreamingenc.c
> +++ b/libavformat/smoothstreamingenc.c
> @@ -394,6 +394,7 @@ static int ism_write_header(AVFormatContext *s)
>      if (!c->has_video && c->min_frag_duration <= 0) {
>          av_log(s, AV_LOG_WARNING, "no video stream and no min frag duration set\n");
>          ret = AVERROR(EINVAL);
> +        goto fail;
>      }
>      ret = write_manifest(s, 0);
>  
> -- 
> 1.9.3 (Apple Git-50)
> 

Looks ok to me.

Patch

diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index ddd8da7..1db2dba 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -394,6 +394,7 @@  static int ism_write_header(AVFormatContext *s)
     if (!c->has_video && c->min_frag_duration <= 0) {
         av_log(s, AV_LOG_WARNING, "no video stream and no min frag duration set\n");
         ret = AVERROR(EINVAL);
+        goto fail;
     }
     ret = write_manifest(s, 0);