Bug 457347

Summary: fix crash in qtav libavfilter with FFMPEG 5
Product: [Applications] digikam Reporter: Steven Robbins <steve>
Component: Preview-VideoAssignee: Digikam Developers <digikam-bugs-null>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Debian unstable   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 8.0.0
Sentry Crash Report:
Attachments: bug fix

Description Steven Robbins 2022-07-31 17:23:05 UTC
Created attachment 151031 [details]
bug fix

SUMMARY

When built using FFMPEG 5, the current git master/HEAD crashes while running  tests/video/qtav/tests/codecslist.  

Stack trace:

Thread 1 "qtav-codecslist" received signal SIGSEGV, Segmentation fault.
0x00007ffff3b82cf9 in av_filter_iterate () from /lib/x86_64-linux-gnu/libavfilter.so.8
(gdb) bt
#0  0x00007ffff3b82cf9 in av_filter_iterate () at /lib/x86_64-linux-gnu/libavfilter.so.8
#1  0x00007ffff76ed947 in QtAV::LibAVFilter::registeredFilters(int) (type=0) at /home/steve/Packages/digikam/upstream/core/libs/video/qtav/filter/LibAVFilter.cpp:479
#2  0x00007ffff76ed0b5 in QtAV::LibAVFilter::videoFilters() () at /home/steve/Packages/digikam/upstream/core/libs/video/qtav/filter/LibAVFilter.cpp:327
#3  0x0000555555555bcc in main(int, char**) () at /home/steve/Packages/digikam/upstream/core/tests/video/qtav/tests/codecslist.cpp:64
(gdb) 


The bug is in how LibAVFilter::registeredFilters() calls av_filter_iterate().  Patch attached.
Comment 1 Steven Robbins 2022-07-31 17:25:22 UTC
Note: I followed the ffmeg example code to implement fix.
See https://ffmpeg.org/doxygen/trunk/opt__common_8c_source.html#l00788
Comment 2 Maik Qualmann 2022-07-31 17:32:51 UTC
Git commit ab1b9df72ce045f76a654c9961f6e74f2da7c3a6 by Maik Qualmann.
Committed on 31/07/2022 at 17:31.
Pushed by mqualmann into branch 'master'.

apply patch #151031 from Steven Robbins to fix crash in qtav libavfilter with FFMPEG 5
FIXED-IN: 8.0.0

M  +2    -2    core/libs/video/qtav/filter/LibAVFilter.cpp

https://invent.kde.org/graphics/digikam/commit/ab1b9df72ce045f76a654c9961f6e74f2da7c3a6