diff mbox series

[FFmpeg-devel] avformat/cafdec: Avoid unnecessary avio_tell() calls

Message ID AM7PR03MB6660F3C39243F345CA40DBBD8F9D9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Commit 7c2b9067d065a1ed503aa76ea82e5dd1763452dd
Headers show
Series [FFmpeg-devel] avformat/cafdec: Avoid unnecessary avio_tell() calls | 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 success Make fate finished

Commit Message

Andreas Rheinhardt Nov. 20, 2021, 12:46 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/cafdec.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 3ff0558afe..4b5b15b58d 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -224,7 +224,7 @@  static int read_pakt_chunk(AVFormatContext *s, int64_t size)
         av_log(s, AV_LOG_ERROR, "error reading packet table\n");
         return AVERROR_INVALIDDATA;
     }
-    avio_skip(pb, ccount + size - avio_tell(pb));
+    avio_seek(pb, ccount + size, SEEK_SET);
 
     caf->num_bytes = pos;
     return 0;
@@ -331,7 +331,7 @@  static int read_header(AVFormatContext *s)
         if (size > 0 && (pb->seekable & AVIO_SEEKABLE_NORMAL)) {
             if (pos > INT64_MAX - size)
                 return AVERROR_INVALIDDATA;
-            avio_skip(pb, FFMAX(0, pos + size - avio_tell(pb)));
+            avio_seek(pb, pos + size, SEEK_SET);
         }
     }