Commit Graph

78 Commits (5b97823db6f7cec6569ef893499cf48f4a889e67)

Author SHA1 Message Date
Rye ba30737d8f Merge branch 'develop' of github.com:secondlife/viewer into rye/infinitemac 2025-08-20 18:04:55 -04:00
Andrey Kleshchev 82e6e42b9e #4527 Crash trying to upload a huge image
Raw image permits only a 256 MB buffer so this isn't unexpected.
2025-08-13 00:21:28 +03:00
Andrey Kleshchev 75bf8577a1 #3884 Crash in kdu_core::kdu_params::get 2025-04-07 21:13:48 +03:00
Rye a80f2ba9a3 Update KDU to 8.4.1 and fix kdu tests, also fix llimage_libtest utility 2025-02-11 05:04:04 -05:00
Ansariel e2e37cced8 Fix line endlings 2024-05-22 22:40:26 +03:00
Ansariel 1b67dd855c Merge remote-tracking branch 'origin/main' into DRTVWR-600-maint-A
# Conflicts:
#	autobuild.xml
#	indra/cmake/CMakeLists.txt
#	indra/cmake/GoogleMock.cmake
#	indra/llaudio/llaudioengine_fmodstudio.cpp
#	indra/llaudio/llaudioengine_fmodstudio.h
#	indra/llaudio/lllistener_fmodstudio.cpp
#	indra/llaudio/lllistener_fmodstudio.h
#	indra/llaudio/llstreamingaudio_fmodstudio.cpp
#	indra/llaudio/llstreamingaudio_fmodstudio.h
#	indra/llcharacter/llmultigesture.cpp
#	indra/llcharacter/llmultigesture.h
#	indra/llimage/llimage.cpp
#	indra/llimage/llimagepng.cpp
#	indra/llimage/llimageworker.cpp
#	indra/llimage/tests/llimageworker_test.cpp
#	indra/llmessage/tests/llmockhttpclient.h
#	indra/llprimitive/llgltfmaterial.h
#	indra/llrender/llfontfreetype.cpp
#	indra/llui/llcombobox.cpp
#	indra/llui/llfolderview.cpp
#	indra/llui/llfolderviewmodel.h
#	indra/llui/lllineeditor.cpp
#	indra/llui/lllineeditor.h
#	indra/llui/lltextbase.cpp
#	indra/llui/lltextbase.h
#	indra/llui/lltexteditor.cpp
#	indra/llui/lltextvalidate.cpp
#	indra/llui/lltextvalidate.h
#	indra/llui/lluictrl.h
#	indra/llui/llview.cpp
#	indra/llwindow/llwindowmacosx.cpp
#	indra/newview/app_settings/settings.xml
#	indra/newview/llappearancemgr.cpp
#	indra/newview/llappearancemgr.h
#	indra/newview/llavatarpropertiesprocessor.cpp
#	indra/newview/llavatarpropertiesprocessor.h
#	indra/newview/llbreadcrumbview.cpp
#	indra/newview/llbreadcrumbview.h
#	indra/newview/llbreastmotion.cpp
#	indra/newview/llbreastmotion.h
#	indra/newview/llconversationmodel.h
#	indra/newview/lldensityctrl.cpp
#	indra/newview/lldensityctrl.h
#	indra/newview/llface.inl
#	indra/newview/llfloatereditsky.cpp
#	indra/newview/llfloatereditwater.cpp
#	indra/newview/llfloateremojipicker.h
#	indra/newview/llfloaterimsessiontab.cpp
#	indra/newview/llfloaterprofiletexture.cpp
#	indra/newview/llfloaterprofiletexture.h
#	indra/newview/llgesturemgr.cpp
#	indra/newview/llgesturemgr.h
#	indra/newview/llimpanel.cpp
#	indra/newview/llimpanel.h
#	indra/newview/llinventorybridge.cpp
#	indra/newview/llinventorybridge.h
#	indra/newview/llinventoryclipboard.cpp
#	indra/newview/llinventoryclipboard.h
#	indra/newview/llinventoryfunctions.cpp
#	indra/newview/llinventoryfunctions.h
#	indra/newview/llinventorygallery.cpp
#	indra/newview/lllistbrowser.cpp
#	indra/newview/lllistbrowser.h
#	indra/newview/llpanelobjectinventory.cpp
#	indra/newview/llpanelprofile.cpp
#	indra/newview/llpanelprofile.h
#	indra/newview/llpreviewgesture.cpp
#	indra/newview/llsavedsettingsglue.cpp
#	indra/newview/llsavedsettingsglue.h
#	indra/newview/lltooldraganddrop.cpp
#	indra/newview/llurllineeditorctrl.cpp
#	indra/newview/llvectorperfoptions.cpp
#	indra/newview/llvectorperfoptions.h
#	indra/newview/llviewerparceloverlay.cpp
#	indra/newview/llviewertexlayer.cpp
#	indra/newview/llviewertexturelist.cpp
#	indra/newview/macmain.h
#	indra/test/test.cpp
2024-05-22 19:04:52 +02:00
Andrey Lihatskiy 1b68f71348 #824 Process source files in bulk: replace tabs with spaces, convert CRLF to LF, and trim trailing whitespaces as needed 2024-04-29 07:56:09 +03:00
Alexander Gavriliuk 74c8b028d4 SL-20743 Use LLMutex in LLImageBase for internal data thread-safety 2023-12-21 19:12:52 +01:00
Andrey Lihatskiy 3954e5d802 DRTVWR-600 macos buildfix 2023-12-15 10:18:32 +02:00
Alexander Gavriliuk 7f9438ed2b SL-3508 Crash in LLKDUDecodeState::processTileDecode 2023-12-15 07:45:05 +01:00
Dave Parks b6841d75c2 SL-17219 WIP - Texture pipeline overhaul 2022-04-15 19:02:07 -05:00
Nat Goodspeed d6baa7a853 DRTVWR-494: Put streaming operator<<() for kdu_dims in kdu_core.
It seems the lookup now requires that the operator<<() function be defined in
the same namespace as the argument.
2020-03-25 15:28:17 -04:00
Nat Goodspeed 1771857e6c Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2017-03-06 14:27:29 -05:00
Rider Linden 25cd2ed205 Merge 2017-01-25 11:13:59 -08:00
Callum Prentice 7b2cf53f78 Pull in new version of KDU third party package that is build (correctly) as a static library vs. a stub library/DLL 2016-11-30 12:21:05 -08:00
Nat Goodspeed 0413e40d82 DRTVWR-418: Update KDU and llimagej2ckdu* with certain clang fixes. 2016-11-03 20:48:41 -04:00
Nat Goodspeed 6cc4a8dcd2 Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2016-11-03 09:31:15 -04:00
Rider Linden 8d86f5a0c4 Merge 2016-09-16 16:00:07 -07:00
Rider Linden 51236b7c9c Merge 2016-09-14 09:55:18 -07:00
Nat Goodspeed c7cb6636c4 MAINT-6584, MAINT-5011: Change new 'throw' to LLTHROW()
to be consistent with new exception conventions.
2016-09-07 10:57:07 -04:00
Nat Goodspeed dd1a0218b1 Automated merge with ssh://bitbucket.org/lindenlab/viewer-vlc 2016-09-07 10:46:28 -04:00
Nat Goodspeed 0eac1f41f6 MAINT-5011: Catch kdu_exception (aka int) in case it leaks out.
KDU internally throws kdu_exception, which is a typedef for int. It's possible
that such an exception might leak out.

Our usual strategy for unknown exceptions is to catch (...) and let
boost::current_exception_diagnostic_information() handle them. However, for
int (or a class not derived from std::exception), that function will only
shrug and report no information available.

Besides, we want to format kdu_exception specially anyway. First, the KDU
#defines are in hex, so we should report the value in hex. But on inspection,
certain of those hex values are actually multibyte ASCII literals in disguise
-- so also report the byte string value.
2016-08-17 16:42:10 -04:00
Nat Goodspeed 83eb960063 MAINT-5011: Derive image-load exceptions from LLContinueError.
Failure to load an image shouldn't crash the whole viewer.
2016-08-17 15:47:08 -04:00
Nat Goodspeed 993f54f6e9 MAINT-5011: Try to enrich catch (...) logging throughout viewer.
Turns out we have a surprising number of catch (...) clauses in the viewer
code base. If all we currently do is

    LL_ERRS() << "unknown exception" << LL_ENDL;

then call CRASH_ON_UNHANDLED_EXCEPTION() instead. If what we do is

    LL_WARNS() << "unknown exception" << LL_ENDL;

then call LOG_UNHANDLED_EXCEPTION() instead.

Since many places need LOG_UNHANDLED_EXCEPTION() and nobody catches
LLContinueError yet, eliminate LLContinueError& parameter from
LOG_UNHANDLED_EXCEPTION(). This permits us to use the same log message as
CRASH_ON_UNHANDLED_EXCEPTION(), just with a different severity level.

Where a catch (...) clause actually provides contextual information, or makes
an error string, add boost::current_exception_diagnostic_information() to try
to figure out actual exception class and message.
2016-08-17 15:40:03 -04:00
Nat Goodspeed db4f13e7bc MAINT-5011: Clean up indentation from merge of viewer-release. 2016-08-17 11:48:33 -04:00
Nat Goodspeed e72bdc9bc5 Automated merge with ssh://bitbucket.org/lindenlab/viewer-release 2016-08-17 11:41:12 -04:00
Nat Goodspeed 5e9d2f57c8 MAINT-5011: Use LLTHROW() instead of plain BOOST_THROW_EXCEPTION().
A level of preprocessor indirection lets us later change the implementation if
desired.
2016-08-17 11:36:24 -04:00
Nat Goodspeed 1773f44b6d MAINT-6584: Don't crash on inconsistent dims in a JPEG-2000 image.
Previous code would crump with LL_ERRS. But a bad image file should fail only
the image load -- not crash the viewer.

While at it, validate all components present, not just 0, 1, 2.

While at it, make the failure message report which component and what the
mismatched dimensions are, not just "Components don't have matching
dimensions!"
2016-08-06 11:39:11 -04:00
Nat Goodspeed 80adc9b6aa MAINT-6584: Introduce KDUError exception from other viewer project.
Specifically, manually apply changesets b4db8a8 and b98371d from
nat_linden/viewer-mac-mainloop. We need to throw from a new place, but if we
threw const char* (current convention), the new throw wouldn't be patched when
we merge to new exception convention.
2016-08-05 17:57:24 -04:00
Nat Goodspeed a5ce63eb3c MAINT-6584: Add explanatory comments to LLImageJ2CKDU implementation.
These comments are inherently fragile, in that they enumerate all present
callers of certain methods. Adding, removing or relocating calls would
invalidate these comments. However, the LLImageJ2CKDU implementation is
probably pretty stable by now.
2016-08-05 17:44:13 -04:00
Nat Goodspeed 65d608cdac MAINT-6584: Clarify LLKDUMessageError::flush() throwing exception. 2016-08-05 14:02:12 -04:00
Nat Goodspeed 2ce38c3c98 MAINT-6584: Comment out completely unused LLImageJ2CKDU code.
The only call to the findDiscardLevelsBoundaries() method was commented out
inside initDecode(), with a comment:
        // Merov : Test!! DO NOT COMMIT!!

This was the only caller of copy_tile(), which was the only caller of
copy_block(). Commented out all three of these (biggish!) functions, since I
have no idea what any of them were supposed to do or when it might be useful
to call them. In other words, I can't yet rule out the possibility that I
might have to uncomment them.
2016-08-04 16:20:39 -04:00
AndreyL ProductEngine 2339e759fc MAINT-4327/MAINT-6584 Supress the crash on memory allocation error when decoding J2C images 2016-07-27 05:49:07 +03:00
Nat Goodspeed 03bff896bd MAINT-6584: Use RAII classes to manage helper object lifespans.
Use boost::scoped_ptr instead of raw pointers to LLKDUMemSource,
LLKDUDecodeState, kdu_coords and kdu_dims so cleanup is simpler, and automated
on destruction of LLImageJ2CKDU.

Replace pointer to kdu_codestream with a custom RAII class. kdu_codestream is
itself an opaque handle, so we don't need to add another layer of indirection.
Just wrap it to ensure its destroy() method is reliably called when needed.

Make static instances of LLKDUMessageWarning and LLKDUMessageError
self-register, eliminating the companion static bool and explicit checks in
code.
2016-08-03 20:40:03 -04:00
Nat Goodspeed acdb050ce5 MAINT-6584: Convert LLImage class hierarchy to standard 'bool'
instead of legacy BOOL.
2016-07-22 11:35:23 -04:00
Nat Goodspeed ab07b1a461 MAINT-6584: Rationalize custom KDU error/warning message classes.
Derive them both from a common base class that does the message logging,
instead of having each handler class log redundantly -- especially since the
put_text() override accepting const kdu_uint16* was simply streaming the
kdu_uint16 pointer to the log file, which would log the hex value of the
pointer.

Although we want a static instance of each of these handler classes, pull it
out rather than nesting the instance within the class itself.
2016-07-22 10:32:53 -04:00
Nat Goodspeed 71b593e88b MAINT-6584: Streamline static LLImageJ2C implementation API.
Specifically, remove unused function pointer types CreateLLImageJ2CFunction,
DestroyLLImageJ2CFunction and EngineInfoLLImageJ2CFunction.

Also eliminate static fallbackDestroyLLImageJ2CImpl() and
fallbackEngineInfoLLImageJ2CImpl(), leaving only static
fallbackCreateLLImageJ2CImpl().

We do need a factory function to instantiate the appropriate LLImageJ2CImpl
subclass, so leave the fallbackCreateLLImageJ2CImpl() link seam in place.

However, given that every known LLImageJ2CImpl subclass is cheap to
instantiate, make getEngineInfo() a pure virtual method on that subclass: the
static LLImageJ2C::getEngineInfo() method can temporarily construct an
instance to query. While we're at it, make getEngineInfo() return std::string
like LLImageJ2C::getEngineInfo(). It's ridiculous that
fallbackEngineInfoLLImageJ2CImpl() implementations constructed a static
std::string and returned its c_str(), only to have LLImageJ2C::getEngineInfo()
construct ANOTHER std::string from the returned const char*.

fallbackDestroyLLImageJ2CImpl() never did anything useful: it merely deleted
the passed LLImageJ2CImpl subclass pointer as the specific subclass type. But
since LLImageJ2CImpl's destructor is virtual, LLImageJ2C's destructor could
simply delete the stored LLImageJ2CImpl*. In fact, make mImpl a
boost::scoped_ptr<LLImageJ2CImpl> so we don't even have to delete it manually.
2016-07-21 16:49:02 -04:00
Nat Goodspeed f09a92f1f3 DRTVWR-427: Remove engineInfoLLImageJ2CKDU(), createLLImageJ2CKDU(),
destroyLLImageJ2CKDU().

These were apparently intended as simple C-style DLL entry points. But as
nobody calls them, and as we decided against building the viewer from DLLs,
they only clutter the code.
2016-07-21 14:29:29 -04:00
Nat Goodspeed 9c49a6c91d MAINT-5011: Introduce LLException base class for viewer exceptions.
This also introduces LLContinueError for exceptions which should interrupt
some part of viewer processing (e.g. the current coroutine) but should attempt
to let the viewer session proceed.

Derive all existing viewer exception classes from LLException rather than from
std::runtime_error or std::logic_error.

Use BOOST_THROW_EXCEPTION() rather than plain 'throw' to enrich the thrown
exception with source file, line number and containing function.
2016-07-19 16:25:25 -04:00
Nat Goodspeed d7c904632b MAINT-5011: On advice from NickyD, say KDUError not KduError.
Also place KDUError into anonymous namespace to emphasize that it's entirely
local to this .cpp file.
2016-07-14 10:26:57 -04:00
Nat Goodspeed 21e8352de6 MAINT-5011: Introduce KduError instead of throw/catch const char*.
KduError is derived from std::runtime_error, so the message string becomes its
what() message.
2016-07-13 14:42:44 -04:00
Nat Goodspeed 5b233bba3f MAINT-5011: Remove alarming ll_kdu_error() function
whose body reads:

    // *FIX: This exception is bad, bad, bad. It gets thrown from a
    // destructor which can lead to immediate program termination!
    throw "ll_kdu_error() throwing an exception";

which would be bad indeed... if ll_kdu_error() were ever actually referenced
by anything!
2016-07-13 14:28:45 -04:00
callum_linden 9c4ed8d113 Automated merge with tip of viewer-release to pick up 4.0.5 2016-05-19 11:00:03 -07:00
callum_linden c5d6bfe8ae Merge with viewer-release 2016-05-06 13:40:29 -07:00
callum_linden 811a0b5726 DRTVWR-418: add preprocessor define to fix linker error introduced in v7.8 2016-04-26 12:14:29 -07:00
Nat Goodspeed a0052fac05 DRTVWR-418: Fix indra/llkdu wrapper for changes in KDU 7.8 API.
KDU 7.8 introduces a number of changes to its API, most notably by moving
public symbols into a variety of kdu_something namespaces. While this is
laudable in a general sense, it does require quite a bit of diagnostic
building and patching to update legacy code.

Since llimagej2ckdu_test.cpp lamentably stubs out pretty much the entire KDU
API, we must also fix those stubs for signature changes even to functions we
don't otherwise reference.

NOTE: This commit still leaves four symbols undefined. Below I have taken the
liberty of juxtaposing the error line with the output from dumpbin /exports
build-vc120/packages/lib/release/kdu.lib. I see no differences.

unresolved symbol (?kdu_convert_ycc_to_rgb_rev16@kdu_core@@3P6AXPAF00H@ZA)   "void (__cdecl* kdu_core::kdu_convert_ycc_to_rgb_rev16)(short *,short *,short *,int)"
                   ?kdu_convert_ycc_to_rgb_rev16@kdu_core@@3P6AXPAF00H@ZA    (void (__cdecl* kdu_core::kdu_convert_ycc_to_rgb_rev16)(short *,short *,short *,int))
unresolved symbol (?kdu_convert_ycc_to_rgb_irrev16@kdu_core@@3P6AXPAF00H@ZA) "void (__cdecl* kdu_core::kdu_convert_ycc_to_rgb_irrev16)(short *,short *,short *,int)"
                   ?kdu_convert_ycc_to_rgb_irrev16@kdu_core@@3P6AXPAF00H@ZA  (void (__cdecl* kdu_core::kdu_convert_ycc_to_rgb_irrev16)(short *,short *,short *,int))
unresolved symbol (?kdu_convert_ycc_to_rgb_rev32@kdu_core@@3P6AXPAH00H@ZA)   "void (__cdecl* kdu_core::kdu_convert_ycc_to_rgb_rev32)(int *,int *,int *,int)"
                   ?kdu_convert_ycc_to_rgb_rev32@kdu_core@@3P6AXPAH00H@ZA    (void (__cdecl* kdu_core::kdu_convert_ycc_to_rgb_rev32)(int *,int *,int *,int))
unresolved symbol (?kdu_convert_ycc_to_rgb_irrev32@kdu_core@@3P6AXPAM00H@ZA) "void (__cdecl* kdu_core::kdu_convert_ycc_to_rgb_irrev32)(float *,float *,float *,int)"
                   ?kdu_convert_ycc_to_rgb_irrev32@kdu_core@@3P6AXPAM00H@ZA  (void (__cdecl* kdu_core::kdu_convert_ycc_to_rgb_irrev32)(float *,float *,float *,int))
24>C:\Users\Nat\linden\viewer64\build-vc120\newview\RelWithDebInfo\secondlife-bin.exe : fatal error LNK1120: 4 unresolved externals
2016-04-25 22:56:58 -04:00
Rider Linden 94d1a54e33 Shift of negative is undefined. 2016-04-12 13:56:49 -07:00
Oz Linden 9be58e915a merge with 4.0.3-release 2016-04-04 15:53:09 -04:00
Oz Linden c8726aba30 remove execute permission from many files that should not have it 2015-11-10 09:48:56 -05:00
Richard Linden e340009fc5 second phase summer cleaning
replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc.
2013-08-09 17:11:19 -07:00