projects
/
dcpomatic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da3dd9d
)
Fix crash when FFmpeg doesn't recognise a file's pixel format.
author
Carl Hetherington
<cth@carlh.net>
Thu, 18 Feb 2016 13:52:41 +0000
(13:52 +0000)
committer
Carl Hetherington
<cth@carlh.net>
Thu, 18 Feb 2016 13:52:41 +0000
(13:52 +0000)
src/lib/ffmpeg_examiner.cc
patch
|
blob
|
history
diff --git
a/src/lib/ffmpeg_examiner.cc
b/src/lib/ffmpeg_examiner.cc
index dacc652bb73b273a5781b8017f95b40a1e8b7aac..29cc69063c12fd60360aa64c061103a939845f46 100644
(file)
--- a/
src/lib/ffmpeg_examiner.cc
+++ b/
src/lib/ffmpeg_examiner.cc
@@
-353,7
+353,13
@@
FFmpegExaminer::stream_name (AVStream* s) const
int
FFmpegExaminer::bits_per_pixel () const
{
- return av_get_bits_per_pixel (av_pix_fmt_desc_get (video_codec_context()->pix_fmt));
+ if (video_codec_context()->pix_fmt == -1) {
+ throw DecodeError (_("Could not find pixel format for video."));
+ }
+
+ AVPixFmtDescriptor const * d = av_pix_fmt_desc_get (video_codec_context()->pix_fmt);
+ DCPOMATIC_ASSERT (d);
+ return av_get_bits_per_pixel (d);
}
bool