We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a827ec6 commit 90cb48bCopy full SHA for 90cb48b
src/AvTranscoder/codec/ICodec.cpp
@@ -82,7 +82,11 @@ void ICodec::openCodec()
82
std::string ICodec::getCodecName() const
83
{
84
assert( _avCodecContext != NULL );
85
- return avcodec_descriptor_get( _avCodecContext->codec_id )->name;
+ const AVCodecDescriptor * desc = avcodec_descriptor_get( _avCodecContext->codec_id );
86
+ if( ! desc )
87
+ throw std::runtime_error( "Codec Descriptor is not available." );
88
+
89
+ return desc->name;
90
}
91
92
AVCodecID ICodec::getCodecId() const
0 commit comments