[FFmpeg-devel] [PATCH 2/2] avcodec/dxv: Subtract 12 earlier in dxv_decompress_cocg()

Michael Niedermayer michael at niedermayer.cc
Tue Sep 24 14:47:45 EEST 2019


the data_start is after reading 12 bytes and if its subtracted
at the very end the intermediate might overflow

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/dxv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index 3fb50e96d0..1486de7341 100644
--- a/libavcodec/dxv.c
+++ b/libavcodec/dxv.c
@@ -783,7 +783,7 @@ static int dxv_decompress_cocg(DXVContext *ctx, GetByteContext *gb,
             return ret;
     }
 
-    bytestream2_seek(gb, data_start + op_offset + skip0 + skip1 - 12, SEEK_SET);
+    bytestream2_seek(gb, data_start - 12 + op_offset + skip0 + skip1, SEEK_SET);
 
     return 0;
 }
-- 
2.23.0



More information about the ffmpeg-devel mailing list