Skip to content

Commit 90cb48b

Browse files
committed
Throw if codec is not available
1 parent a827ec6 commit 90cb48b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/AvTranscoder/codec/ICodec.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@ void ICodec::openCodec()
8282
std::string ICodec::getCodecName() const
8383
{
8484
assert( _avCodecContext != NULL );
85-
return avcodec_descriptor_get( _avCodecContext->codec_id )->name;
85+
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;
8690
}
8791

8892
AVCodecID ICodec::getCodecId() const

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy