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 841fa76 commit 57dbe41Copy full SHA for 57dbe41
src/AvTranscoder/EssenceStructures/Pixel.cpp
@@ -10,6 +10,8 @@ extern "C" {
10
#include <libavutil/pixdesc.h>
11
}
12
13
+#include <stdexcept>
14
+
15
namespace avtranscoder
16
{
17
@@ -65,7 +67,13 @@ AVPixelFormat Pixel::findPixel() const
65
67
66
68
void Pixel::init( const AVPixelFormat avPixelFormat )
69
- const AVPixFmtDescriptor *pix_desc = av_pix_fmt_desc_get( avPixelFormat );
70
+ const AVPixFmtDescriptor* pix_desc = av_pix_fmt_desc_get( avPixelFormat );
71
72
+ if( ! pix_desc )
73
+ {
74
+ throw std::runtime_error( "unable to find pixel format." );
75
+ }
76
77
setBitsPerPixel ( av_get_bits_per_pixel( pix_desc ) );
78
setBigEndian ( pix_desc->flags & PIX_FMT_BE );
79
setComponents ( pix_desc->nb_components );
0 commit comments