diff mbox series

[FFmpeg-devel,2/2] avformat/rmdec: Don't rely on unspecified order of evaluation

Message ID HE1PR0301MB215425DA5CA89CA8EFDEBDF48F759@HE1PR0301MB2154.eurprd03.prod.outlook.com
State Accepted
Commit 4666ce0aef395fc7dfa2a718e8d238e58e635d2a
Headers show
Series [FFmpeg-devel] avformat/rmdec: Fix memleaks upon read_header failure
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt April 7, 2021, 11:38 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavformat/rmdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index 1dec70e95b..fc3bff4859 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -1312,7 +1312,7 @@  static int ivr_read_header(AVFormatContext *s)
     if (avio_r8(pb) != 6)
         goto invalid_data;
     avio_skip(pb, 12);
-    avio_skip(pb, avio_rb64(pb) + pos - avio_tell(s->pb));
+    avio_seek(pb, avio_rb64(pb) + pos, SEEK_SET);
     if (avio_r8(pb) != 8)
         goto invalid_data;
     avio_skip(pb, 8);