StrataSource / vtex2

A VTF converter and editor
MIT License
42 stars 8 forks source link

Selecting DXT1 Image Format When Nothing Is Loaded Causes The Program To Crash #52

Closed HurricanePootis closed 4 months ago

HurricanePootis commented 4 months ago

System Information

Arch Linux QT 6.7.1 Linux 6.9.3

What happens

Whenever I open up vtfview, and I select DXT1 under Image Formats with nothing loaded, the program segfaults.

Backtrace

Thread 1 "vtfview" received signal SIGSEGV, Segmentation fault.
0x000055555556e998 in VTFLib::CVTFFile::GetFormat (this=0x0) at /home/hurricane/aur/vtex2/src/vtex2/external/vtflib/VTFLib/VTFFile.cpp:2002
2002            if(!this->IsLoaded())
(gdb) bt
#0  0x000055555556e998 in VTFLib::CVTFFile::GetFormat (this=0x0) at /home/hurricane/aur/vtex2/src/vtex2/external/vtflib/VTFLib/VTFFile.cpp:2002
#1  vtfview::Document::set_format (this=0x55555ccd65c0, format=IMAGE_FORMAT_DXT1) at /home/hurricane/aur/vtex2/src/vtex2/src/gui/document.cpp:112
#2  operator() (__closure=0x55555cfed220, index=<optimized out>) at /home/hurricane/aur/vtex2/src/vtex2/src/gui/viewer.cpp:557
#3  QtPrivate::FunctorCall<QtPrivate::IndexesList<0>, QtPrivate::List<int>, void, vtfview::InfoWidget::setup_ui()::<lambda(int)> >::call (f=..., arg=<optimized out>)
    at /usr/include/qt6/QtCore/qobjectdefs_impl.h:137
#4  QtPrivate::FunctorCallable<vtfview::InfoWidget::setup_ui()::<lambda(int)>, int>::call<QtPrivate::List<int>, void> (f=..., arg=<optimized out>) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:345
#5  QtPrivate::QCallableObject<vtfview::InfoWidget::setup_ui()::<lambda(int)>, QtPrivate::List<int>, void>::impl(int, QtPrivate::QSlotObjectBase *, QObject *, void **, bool *)
    (which=<optimized out>, this_=0x55555cfed210, r=<optimized out>, a=0x7fffffffc700, ret=0x0) at /usr/include/qt6/QtCore/qobjectdefs_impl.h:555
#6  0x00007ffff69a17e7 in QtPrivate::QSlotObjectBase::call (this=0x55555cfed210, r=0x55555cf01590, a=0x7fffffffc700, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469
#7  doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4086
#8  0x00007ffff7a2c640 in QComboBox::currentIndexChanged (this=0x55555cf01590, _t1=<optimized out>) at /usr/src/debug/qt6-base/build/src/widgets/Widgets_autogen/include/moc_qcombobox.cpp:457
#9  QComboBoxPrivate::emitCurrentIndexChanged (this=0x55555ce1dc80, index=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/widgets/widgets/qcombobox.cpp:1425
#10 0x00007ffff7a3aa1f in QComboBoxPrivate::setCurrentIndex (this=0x55555ce1dc80, mi=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/widgets/widgets/qcombobox.cpp:2207
#11 0x00007ffff7a32757 in QComboBoxPrivate::itemSelected (this=0x55555ce1dc80, item=...) at /usr/src/debug/qt6-base/qtbase/src/widgets/widgets/qcombobox.cpp:1393
#12 0x00007ffff69a17e7 in QtPrivate::QSlotObjectBase::call (this=0x55555d165850, r=0x55555cf01590, a=0x7fffffffc970, this=<optimized out>, r=<optimized out>, a=<optimized out>)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobjectdefs_impl.h:469
#13 doActivate<false> (sender=<optimized out>, signal_index=<optimized out>, argv=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qobject.cpp:4086
#14 0x00007ffff7a360ba in QComboBoxPrivateContainer::itemSelected (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/qt6-base/build/src/widgets/Widgets_autogen/include/moc_qcombobox_p.cpp:363
#15 0x00007ffff7a3218b in QComboBoxPrivateContainer::eventFilter (this=0x55555ce44040, o=0x55555cf96e90, e=0x7fffffffcf70) at /usr/src/debug/qt6-base/qtbase/src/widgets/widgets/qcombobox.cpp:780
#16 0x00007ffff6944288 in QCoreApplicationPrivate::sendThroughObjectEventFilters (receiver=receiver@entry=0x55555cf96e90, event=event@entry=0x7fffffffcf70)
    at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1281
#17 0x00007ffff78fc54c in QApplicationPrivate::notify_helper (this=this@entry=0x55555c99ebb0, receiver=receiver@entry=0x55555cf96e90, e=e@entry=0x7fffffffcf70)
    at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3281
#18 0x00007ffff7901a01 in QApplication::notify (this=<optimized out>, receiver=<optimized out>, e=0x7fffffffcf70) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2765
#19 0x00007ffff6944e38 in QCoreApplication::notifyInternal2 (receiver=0x55555cf96e90, event=0x7fffffffcf70) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1142
#20 0x00007ffff6944e8d in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1597
#21 0x00007ffff78f3e6d in QApplicationPrivate::sendMouseEvent
    (receiver=0x55555cf96e90, event=0x7fffffffcf70, alienWidget=<optimized out>, nativeWidget=0x55555ce44040, buttonDown=<optimized out>, lastMouseReceiver=..., spontaneous=true, onlyDispatchEnterLeave=false)
    at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2347
#22 0x00007ffff79625f0 in QWidgetWindow::handleMouseEvent (this=0x55555d112dd0, event=event@entry=0x7fffffffd3c0) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qwidgetwindow.cpp:545
#23 0x00007ffff79636b0 in QWidgetWindow::event (this=0x55555d112dd0, event=0x7fffffffd3c0) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qwidgetwindow.cpp:263
#24 0x00007ffff78fc55c in QApplicationPrivate::notify_helper (this=<optimized out>, receiver=0x55555d112dd0, e=0x7fffffffd3c0) at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:3287
#25 0x00007ffff6944e38 in QCoreApplication::notifyInternal2 (receiver=0x55555d112dd0, event=0x7fffffffd3c0) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1142
#26 0x00007ffff6944e8d in QCoreApplication::sendSpontaneousEvent (receiver=<optimized out>, event=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qcoreapplication.cpp:1597
#27 0x00007ffff6f76cf0 in QGuiApplicationPrivate::processMouseEvent (e=0x7fffe4001aa0) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qguiapplication.cpp:2327
#28 0x00007ffff6fe5b44 in QWindowSystemInterface::sendWindowSystemEvents (flags=...) at /usr/src/debug/qt6-base/qtbase/src/gui/kernel/qwindowsysteminterface.cpp:1114
#29 0x00007ffff73f9594 in userEventSourceDispatch (source=<optimized out>) at /usr/src/debug/qt6-base/qtbase/src/gui/platform/unix/qeventdispatcher_glib.cpp:38
#30 0x00007ffff6122a89 in g_main_dispatch (context=0x7fffec000f00) at ../glib/glib/gmain.c:3344
#31 0x00007ffff61849b7 in g_main_context_dispatch_unlocked (context=0x7fffec000f00) at ../glib/glib/gmain.c:4152
#32 g_main_context_iterate_unlocked.isra.0 (context=context@entry=0x7fffec000f00, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at ../glib/glib/gmain.c:4217
#33 0x00007ffff6121f95 in g_main_context_iteration (context=0x7fffec000f00, may_block=1) at ../glib/glib/gmain.c:4282
#34 0x00007ffff6ba28dd in QEventDispatcherGlib::processEvents (this=0x55555c9ba0e0, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventdispatcher_glib.cpp:394
#35 0x00007ffff694f10e in QEventLoop::processEvents (this=0x7fffffffd820, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:100
#36 QEventLoop::exec (this=0x7fffffffd820, flags=...) at /usr/src/debug/qt6-base/qtbase/src/corelib/kernel/qeventloop.cpp:182
#37 0x00007ffff694945d in QCoreApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/corelib/global/qflags.h:74
#38 0x00007ffff78f83fa in QApplication::exec () at /usr/src/debug/qt6-base/qtbase/src/widgets/kernel/qapplication.cpp:2555
#39 0x0000555555562c98 in main (argc=<optimized out>, argv=<optimized out>) at /home/hurricane/aur/vtex2/src/vtex2/src/gui/main.cpp:20