Skip to content

Commit 7566857

Browse files
committed
Merge pull request #205 from fabiencastan/dev_codecNotAvailable
ICodec: throw if codec is not available
2 parents a827ec6 + 90cb48b commit 7566857

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