From 443d0ae63fad6dfd8c485d609203db16c8bd0ec3 Mon Sep 17 00:00:00 2001 From: Dmitry Kurtaev Date: Mon, 8 Sep 2025 08:52:56 +0300 Subject: [PATCH] Merge pull request #27746 from dkurt:d.kurtaev/av_packet_side_data_get fix: FFmpeg 8.0 support #27746 ### Pull Request Readiness Checklist related comment: https://github.com/opencv/opencv/pull/27691#discussion_r2322695640 See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake --- modules/videoio/src/cap_ffmpeg_impl.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/videoio/src/cap_ffmpeg_impl.hpp b/modules/videoio/src/cap_ffmpeg_impl.hpp index 5780b4c113..d971ca75b3 100644 --- a/modules/videoio/src/cap_ffmpeg_impl.hpp +++ b/modules/videoio/src/cap_ffmpeg_impl.hpp @@ -2017,7 +2017,10 @@ void CvCapture_FFMPEG::get_rotation_angle() if (sd && nb_sd > 0) { const AVPacketSideData* mtx = av_packet_side_data_get(sd, nb_sd, AV_PKT_DATA_DISPLAYMATRIX); - data = mtx->data; + if (mtx) + { + data = mtx->data; + } } # endif if (data)