diff mbox series

[FFmpeg-devel,2/6] avformat/gifdec: Check ffio_ensure_seekback()

Message ID GV1P250MB0737A2CC9791AB7F9ECD41B68FEB2@GV1P250MB0737.EURP250.PROD.OUTLOOK.COM
State Accepted
Commit 590fffe6adcfdc13e6f520a47be0ece72fe0707d
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 #1598400.

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

Patch

diff --git a/libavformat/gifdec.c b/libavformat/gifdec.c
index 294007682b..d5f06adc64 100644
--- a/libavformat/gifdec.c
+++ b/libavformat/gifdec.c
@@ -85,7 +85,10 @@  static int gif_probe(const AVProbeData *p)
 
 static int resync(AVIOContext *pb)
 {
-    ffio_ensure_seekback(pb, 13);
+    int ret = ffio_ensure_seekback(pb, 13);
+    if (ret < 0)
+        return ret;
+
     for (int i = 0; i < 6; i++) {
         int b = avio_r8(pb);
         if (b != gif87a_sig[i] && b != gif89a_sig[i])