X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fffmpeg_image_proxy.cc;h=9c91d1d87d7d6c60eb883ee346acbb14876bf5ee;hb=f06c5136e7d3cd0a8e1814763c7774859998efe4;hp=3548117ff092e7847975cb9952ec9660ae35ba65;hpb=faf333e4b8b504609c5b721f6752005f071769be;p=dcpomatic.git diff --git a/src/lib/ffmpeg_image_proxy.cc b/src/lib/ffmpeg_image_proxy.cc index 3548117ff..9c91d1d87 100644 --- a/src/lib/ffmpeg_image_proxy.cc +++ b/src/lib/ffmpeg_image_proxy.cc @@ -146,7 +146,11 @@ FFmpegImageProxy::image (optional) const e = avformat_open_input (&format_context, "foo.tga", f, &options); } if (e < 0) { - throw OpenFileError (_path->string(), e, true); + if (_path) { + throw OpenFileError (_path->string(), e, OpenFileError::READ); + } else { + boost::throw_exception(DecodeError(String::compose(_("Could not decode image (%1)"), e))); + } } if (avformat_find_stream_info(format_context, 0) < 0) {