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

pal at sandflow.com pal at sandflow.com
Sun Jan 2 19:22:26 EET 2022


From: Pierre-Anthony Lemieux <pal at palemieux.com>

Signed-off-by: Pierre-Anthony Lemieux <pal at 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);
-- 
2.17.1



More information about the ffmpeg-devel mailing list