summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/ffmpeg_examiner.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/ffmpeg_examiner.cc b/src/lib/ffmpeg_examiner.cc
index dacc652bb..29cc69063 100644
--- 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