diff mbox series

[FFmpeg-devel,4/6] avformat/qoadec: Check ffio_ensure_seekback()

Message ID GV1P250MB07376D88B09B87C3445A76458FEB2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 95faf45af16b15d55b3d9f8f3244d1437649d763
Headers show
Series [FFmpeg-devel,1/6] avformat/oggdec: Check ffio_ensure_seekback() | expand

Checks

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

Commit Message

Andreas Rheinhardt May 22, 2024, 5:08 a.m. UTC
Fixes Coverity issue #1598406.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/qoadec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/qoadec.c b/libavformat/qoadec.c
index 9cce5157fc..a9632c46c3 100644
--- a/libavformat/qoadec.c
+++ b/libavformat/qoadec.c
@@ -41,6 +41,7 @@  static int qoa_read_header(AVFormatContext *s)
 {
     AVIOContext *pb = s->pb;
     AVStream *st;
+    int ret;
 
     st = avformat_new_stream(s, NULL);
     if (!st)
@@ -52,7 +53,9 @@  static int qoa_read_header(AVFormatContext *s)
     st->duration = avio_rb32(pb);
     st->start_time = 0;
 
-    ffio_ensure_seekback(pb, 4);
+    ret = ffio_ensure_seekback(pb, 4);
+    if (ret < 0)
+        return ret;
     st->codecpar->ch_layout.nb_channels = avio_r8(pb);
     if (st->codecpar->ch_layout.nb_channels == 0)
         return AVERROR_INVALIDDATA;