Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix null pointer dereference #2

Merged
merged 1 commit into from Jun 13, 2022
Merged

Conversation

Karry
Copy link
Contributor

@Karry Karry commented Jun 9, 2022

QML VideoOutput documentation says that "...you can provide a QObject
based class with a writable videoSurface property..." (as a source).
QDeclarativeVideoOutput then tries to initialize video backend with
nullptr service. It leads to null pointer dereference and crash
in NemoVideoTextureBackend::init.

Crash stacktrace:

#0  0x0000007280487ed0 in NemoVideoBackend::NemoVideoTextureBackend::init (this=0x60b4fb10d0, service=0x0) at videotexturebackend.cpp:614
#1  0x0000007284a26ea4 in QDeclarativeVideoOutput::createBackend (this=this@entry=0x60b4f84c10, service=service@entry=0x0) at /usr/include/qt5/QtCore/qscopedpointer.h:127
#2  0x0000007284a27c14 in QDeclarativeVideoOutput::setSource (this=0x60b4f84c10, source=0x60b527f520) at qdeclarativevideooutput.cpp:206
#3  0x0000007284a2f078 in QDeclarativeVideoOutput::qt_metacall (this=0x60b4f84c10, _c=QMetaObject::WriteProperty, _id=0, _a=0x7ff48f04c0) at .moc/moc_qdeclarativevideooutput_p.cpp:343
#4  0x000000728e71bd74 in QQmlPropertyPrivate::write (object=object@entry=0x60b4f84c10, property=..., value=..., context=0x60b4f55e20, flags=flags@entry=...) at qml/qqmlproperty.cpp:1252

QML VideoOutput documentation says that "...you can provide a QObject
based class with a writable `videoSurface` property..." (as a source).
QDeclarativeVideoOutput then tries to initialize video backend with
nullptr service. It leads to null pointer dereference and crash
in NemoVideoTextureBackend::init.

Crash stacktrace:

	#0  0x0000007280487ed0 in NemoVideoBackend::NemoVideoTextureBackend::init (this=0x60b4fb10d0, service=0x0) at videotexturebackend.cpp:614
	sailfishos#1  0x0000007284a26ea4 in QDeclarativeVideoOutput::createBackend (this=this@entry=0x60b4f84c10, service=service@entry=0x0) at /usr/include/qt5/QtCore/qscopedpointer.h:127
	sailfishos#2  0x0000007284a27c14 in QDeclarativeVideoOutput::setSource (this=0x60b4f84c10, source=0x60b527f520) at qdeclarativevideooutput.cpp:206
	#3  0x0000007284a2f078 in QDeclarativeVideoOutput::qt_metacall (this=0x60b4f84c10, _c=QMetaObject::WriteProperty, _id=0, _a=0x7ff48f04c0) at .moc/moc_qdeclarativevideooutput_p.cpp:343
	#4  0x000000728e71bd74 in QQmlPropertyPrivate::write (object=object@entry=0x60b4f84c10, property=..., value=..., context=0x60b4f55e20, flags=flags@entry=...) at qml/qqmlproperty.cpp:1252
Copy link
Member

@monich monich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rainemak rainemak merged commit 658d883 into sailfishos:master Jun 13, 2022
@rainemak
Copy link
Member

For integration purposes created JB#58252

@Karry Karry deleted the null-dereference branch July 3, 2022 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants