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

Crash on liveview resize in v2.2.6 #294

Open
antonsviridenko opened this issue Mar 28, 2017 · 2 comments
Open

Crash on liveview resize in v2.2.6 #294

antonsviridenko opened this issue Mar 28, 2017 · 2 comments

Comments

@antonsviridenko
Copy link
Contributor

Affects client version 2.2.6,
steps to reproduce:

  1. open many cameras in liveview,
  2. try to resize liveview area to smaller size my quickly moving sliders

screenshot from 2017-03-28 20-42-43

gdb output

[New Thread 0x7fff3f7fe700 (LWP 28635)]
EventsLoader: Parsed event data into 16 events 
[swscaler @ 0x7fff380875e0] 416x240 -> 0x0 is invalid scaling dimension
ASSERT: "m_avFrame" in file /home/build/bluecherry-client-scripts/package/bluecherry-client-2.2.6/src/rtsp-stream/RtspStreamFrame.cpp, line 27
EventsLoader: Parsed event data into 50 events 

Thread 11 "QThread" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fff3ffff700 (LWP 28610)]
0x00007ffff1c3b428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54	../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff1c3b428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff1c3d02a in __GI_abort () at abort.c:89
#2  0x00007ffff3bd3f15 in qt_message_output(QtMsgType, char const*) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#3  0x00007ffff3bd4371 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#4  0x00007ffff3bd4c91 in qFatal(char const*, ...) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#5  0x00000000004cd479 in RtspStreamFrame::RtspStreamFrame (this=0x7fff382515c0, avFrame=0x0, width=416, height=240)
    at /home/build/bluecherry-client-scripts/package/bluecherry-client-2.2.6/src/rtsp-stream/RtspStreamFrame.cpp:27
#6  0x00000000004cd688 in RtspStreamFrameFormatter::formatFrame (this=0x7fff380013d0, avFrame=0x7fff38097d00, width=0, height=0)
    at /home/build/bluecherry-client-scripts/package/bluecherry-client-2.2.6/src/rtsp-stream/RtspStreamFrameFormatter.cpp:69
#7  0x00000000004d0fe0 in RtspStreamWorker::processVideoFrame (this=0x10a6240, rawFrame=0x7fff38097d00)
    at /home/build/bluecherry-client-scripts/package/bluecherry-client-2.2.6/src/rtsp-stream/RtspStreamWorker.cpp:277
#8  0x00000000004d0c05 in RtspStreamWorker::processPacket (this=0x10a6240, packet=...) at /home/build/bluecherry-client-scripts/package/bluecherry-client-2.2.6/src/rtsp-stream/RtspStreamWorker.cpp:185
#9  0x00000000004d0943 in RtspStreamWorker::processStream (this=0x10a6240) at /home/build/bluecherry-client-scripts/package/bluecherry-client-2.2.6/src/rtsp-stream/RtspStreamWorker.cpp:131
#10 0x00000000004d08be in RtspStreamWorker::processStreamLoop (this=0x10a6240) at /home/build/bluecherry-client-scripts/package/bluecherry-client-2.2.6/src/rtsp-stream/RtspStreamWorker.cpp:120
#11 0x00000000004d085a in RtspStreamWorker::run (this=0x10a6240) at /home/build/bluecherry-client-scripts/package/bluecherry-client-2.2.6/src/rtsp-stream/RtspStreamWorker.cpp:108
#12 0x0000000000554c4f in RtspStreamWorker::qt_static_metacall (_o=0x10a6240, _c=QMetaObject::InvokeMetaMethod, _id=6, _a=0x7fff3fffecd0)
    at /home/build/bluecherry-client-scripts/package/bluecherry-client-2.2.6/obj-x86_64-linux-gnu/src/rtsp-stream/moc_RtspStreamWorker.cxx:68
#13 0x00007ffff3d03010 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#14 0x00007ffff3bdee25 in ?? () from /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#15 0x00007ffff28776ba in start_thread (arg=0x7fff3ffff700) at pthread_create.c:333
#16 0x00007ffff1d0c82d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:109
(gdb) 

Frame size should be checked for 0 before passing to sws_scale

@antonsviridenko
Copy link
Contributor Author

[swscaler @ 0x7fdc70366a40] 416x240 -> -9x-5 is invalid scaling dimension
[swscaler @ 0x7fdc7036aa40] 416x240 -> -9x-5 is invalid scaling dimension

check for negative values too

@AlexanderAgd
Copy link
Contributor

AlexanderAgd commented May 10, 2017

I suppose I fixed it here
8991697

  •    /* In some cases opt rect width and height may be negative */
    
  •    if (opt->rect.width() > 0 && opt->rect.height() > 0)
    
  •        m_stream.data()->setFrameSizeHint(opt->rect.width(), opt->rect.height());
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants