projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b5abb07
)
Fix crash with subtitles for which we have no codec.
author
Carl Hetherington
<cth@carlh.net>
Thu, 16 Nov 2023 14:14:16 +0000
(15:14 +0100)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 16 Nov 2023 14:14:16 +0000
(15:14 +0100)
src/lib/ffmpeg_decoder.cc
patch
|
blob
|
history
diff --git
a/src/lib/ffmpeg_decoder.cc
b/src/lib/ffmpeg_decoder.cc
index c3d32bc752306abd1beb81f6042a80a9bc9acc9c..6e9d671a2fa87792e2ea5b58d6b2d9b2e136822c 100644
(file)
--- a/
src/lib/ffmpeg_decoder.cc
+++ b/
src/lib/ffmpeg_decoder.cc
@@
-634,9
+634,14
@@
FFmpegDecoder::process_video_frame ()
void
FFmpegDecoder::decode_and_process_subtitle_packet (AVPacket* packet)
{
+ auto context = subtitle_codec_context();
+ if (!context) {
+ return;
+ }
+
int got_subtitle;
AVSubtitle sub;
- if (avcodec_decode_subtitle2
(subtitle_codec_context()
, &sub, &got_subtitle, packet) < 0 || !got_subtitle) {
+ if (avcodec_decode_subtitle2
(context
, &sub, &got_subtitle, packet) < 0 || !got_subtitle) {
return;
}