vcl/source/filter/jpeg/Exif.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
New commits: commit 93e3ed3d4afe5cf16c3d97cff27d7d0ab886f179 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Oct 10 21:43:25 2025 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sat Oct 11 15:16:37 2025 +0200 ofz Use-of-uninitialized-value Change-Id: I3dfc1296e174d6751300991f214e99b09d745e5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192188 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/vcl/source/filter/jpeg/Exif.cxx b/vcl/source/filter/jpeg/Exif.cxx index 32871b889e32..e0e3a919f98e 100644 --- a/vcl/source/filter/jpeg/Exif.cxx +++ b/vcl/source/filter/jpeg/Exif.cxx @@ -84,13 +84,12 @@ bool Exif::processJpeg(SvStream& rStream, bool bSetValue) rStream.Seek(p); }); - sal_uInt16 aMagic16; - sal_uInt16 aLength; - sal_uInt64 aSize = rStream.TellEnd(); rStream.Seek(STREAM_SEEK_TO_BEGIN); rStream.SetEndian( SvStreamEndian::BIG ); + + sal_uInt16 aMagic16(0); rStream.ReadUInt16( aMagic16 ); // Compare JPEG magic bytes @@ -104,9 +103,8 @@ bool Exif::processJpeg(SvStream& rStream, bool bSetValue) while(true) { sal_uInt8 aMarker = 0xD9; - sal_Int32 aCount; - for (aCount = 0; aCount < 7; aCount++) + for (sal_Int32 aCount = 0; aCount < 7; aCount++) { rStream.ReadUChar( aMarker ); if (aMarker != 0xFF) @@ -119,6 +117,7 @@ bool Exif::processJpeg(SvStream& rStream, bool bSetValue) } } + sal_uInt16 aLength(0); rStream.ReadUInt16( aLength ); if (aLength < 8 || aLength > rStream.remainingSize())
