From da5445a09fb5ae3da8e0b5a9bddd7013a899d5ec Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Wed, 23 Oct 2013 14:33:03 -0700 Subject: [PATCH] Fix incorrect scope of variable in mkv_wrap.cpp Worked by coincidence since the required value was left on the stack. CID #1111282. --- aegisub/src/mkv_wrap.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aegisub/src/mkv_wrap.cpp b/aegisub/src/mkv_wrap.cpp index bbaa1d222..2867b6d70 100644 --- a/aegisub/src/mkv_wrap.cpp +++ b/aegisub/src/mkv_wrap.cpp @@ -265,8 +265,9 @@ longlong StdIoScan(InputStream *st, ulonglong start, unsigned signature) { return -1; int c; + unsigned cmp = 0; while ((c = getc(fp)) != EOF) { - unsigned cmp = ((cmp << 8) | c) & 0xffffffff; + cmp = ((cmp << 8) | c) & 0xffffffff; if (cmp == signature) return std_ftell(fp) - 4; }