diff mbox series

[FFmpeg-devel,v1] avformat/imf: Fix error handling in set_context_streams_from_tracks()

Message ID 20220102172226.12557-1-pal@sandflow.com
State New
Headers show
Series [FFmpeg-devel,v1] avformat/imf: Fix error handling in set_context_streams_from_tracks() | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_ppc success Make finished
andriy/make_fate_ppc fail Make fate failed

Commit Message

Pierre-Anthony Lemieux Jan. 2, 2022, 5:22 p.m. UTC
From: Pierre-Anthony Lemieux <pal@palemieux.com>

Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
---
 libavformat/imfdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Zane van Iperen Jan. 3, 2022, 11:34 a.m. UTC | #1
On Monday, 3 January 2022 3:22:26 AM AEST pal@sandflow.com wrote:
> From: Pierre-Anthony Lemieux <pal@palemieux.com>
> 
> Signed-off-by: Pierre-Anthony Lemieux <pal@palemieux.com>
> ---
>  libavformat/imfdec.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
> index f17064cfcd..da8c6cddea 100644
> --- a/libavformat/imfdec.c
> +++ b/libavformat/imfdec.c
> @@ -564,9 +564,8 @@ static int set_context_streams_from_tracks(AVFormatContext *s)
>          /* Copy stream information */
>          asset_stream = avformat_new_stream(s, NULL);
>          if (!asset_stream) {
> -            ret = AVERROR(ENOMEM);
>              av_log(s, AV_LOG_ERROR, "Could not create stream\n");
> -            break;
> +            return AVERROR(ENOMEM);
>          }
>          asset_stream->id = i;
>          ret = avcodec_parameters_copy(asset_stream->codecpar, first_resource_stream->codecpar);
> 

lgtm
diff mbox series

Patch

diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
index f17064cfcd..da8c6cddea 100644
--- a/libavformat/imfdec.c
+++ b/libavformat/imfdec.c
@@ -564,9 +564,8 @@  static int set_context_streams_from_tracks(AVFormatContext *s)
         /* Copy stream information */
         asset_stream = avformat_new_stream(s, NULL);
         if (!asset_stream) {
-            ret = AVERROR(ENOMEM);
             av_log(s, AV_LOG_ERROR, "Could not create stream\n");
-            break;
+            return AVERROR(ENOMEM);
         }
         asset_stream->id = i;
         ret = avcodec_parameters_copy(asset_stream->codecpar, first_resource_stream->codecpar);