aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-19 16:36:25 +0000
committertobigun <tobigun@b956fd51-792f-4845-bead-9b4dfca2ff2c>2010-06-19 16:36:25 +0000
commit008c58c6ac1cdbe0fdb01ce79567b7f0e815b83a (patch)
treebff5dba1523f8143ca3d77f8c0de1da687d08e8f
parent241ff0a55e306bfdf2be3f999e4b1644a4398cb6 (diff)
downloadusdx-008c58c6ac1cdbe0fdb01ce79567b7f0e815b83a.tar.gz
usdx-008c58c6ac1cdbe0fdb01ce79567b7f0e815b83a.tar.xz
usdx-008c58c6ac1cdbe0fdb01ce79567b7f0e815b83a.zip
Bugfix: do not call Inc() on PByteArray pointers. It will not increment by one byte, but by SizeOf(ByteArray) bytes which is some KB. As a result the pointer will point to an illegal memory address.
git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@2549 b956fd51-792f-4845-bead-9b4dfca2ff2c
-rw-r--r--src/base/UMusic.pas2
-rw-r--r--src/media/UAudioDecoder_FFmpeg.pas2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/base/UMusic.pas b/src/base/UMusic.pas
index 41d6e80c..ff0fad04 100644
--- a/src/base/UMusic.pas
+++ b/src/base/UMusic.pas
@@ -1006,7 +1006,7 @@ begin
Sample[0] := Value;
Sample[1] := Value;
// increase to next frame
- Inc(Buffer, FrameSize);
+ Inc(PByte(Buffer), FrameSize);
end;
end;
diff --git a/src/media/UAudioDecoder_FFmpeg.pas b/src/media/UAudioDecoder_FFmpeg.pas
index c64d79c2..b44c7b11 100644
--- a/src/media/UAudioDecoder_FFmpeg.pas
+++ b/src/media/UAudioDecoder_FFmpeg.pas
@@ -934,7 +934,7 @@ begin
Break;
end;
- Inc(fAudioPaketData, PaketDecodedSize);
+ Inc(PByte(fAudioPaketData), PaketDecodedSize);
Dec(fAudioPaketSize, PaketDecodedSize);
// check if avcodec_decode_audio returned data, otherwise fetch more frames