[FFmpeg-cvslog] avcodec/dxv: Subtract 12 earlier in dxv_decompress_cocg()

Michael Niedermayer git at videolan.org
Tue Oct 8 17:28:31 EEST 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Tue Sep 24 12:40:35 2019 +0200| [dd9e6d077ea3259cc6c1896334bbbc7f948979b7] | committer: Michael Niedermayer

avcodec/dxv: Subtract 12 earlier in dxv_decompress_cocg()

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>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd9e6d077ea3259cc6c1896334bbbc7f948979b7
---

 libavcodec/dxv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/dxv.c b/libavcodec/dxv.c
index df63006d04..b51d6393b0 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;
 }



More information about the ffmpeg-cvslog mailing list