diff mbox series

[FFmpeg-devel] avformat/sapdec: check return value of avcodec_parameters_copy()

Message ID 20241012173212.2548045-1-marth64@proxyid.net
State New
Headers show
Series [FFmpeg-devel] avformat/sapdec: check return value of avcodec_parameters_copy() | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished

Commit Message

Marth64 Oct. 12, 2024, 5:32 p.m. UTC
Written in the dominant style of the surrounding code block.

Signed-off-by: Marth64 <marth64@proxyid.net>
---
 libavformat/sapdec.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/sapdec.c b/libavformat/sapdec.c
index d5b5d71c02..22db3803c9 100644
--- a/libavformat/sapdec.c
+++ b/libavformat/sapdec.c
@@ -179,7 +179,9 @@  static int sap_read_header(AVFormatContext *s)
             goto fail;
         }
         st->id = i;
-        avcodec_parameters_copy(st->codecpar, sap->sdp_ctx->streams[i]->codecpar);
+        ret = avcodec_parameters_copy(st->codecpar, sap->sdp_ctx->streams[i]->codecpar);
+        if (ret < 0)
+            goto fail;
         st->time_base = sap->sdp_ctx->streams[i]->time_base;
     }