File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/AvTranscoder/mediaProperty Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -31,9 +31,10 @@ std::string PixelProperties::getPixelName() const
31
31
if ( ! _pixelDesc )
32
32
throw std::runtime_error ( " unable to find pixel description." );
33
33
34
- if ( _pixelDesc && _pixelDesc->name )
35
- return std::string ( _pixelDesc->name );
36
- return " unknown pixel name" ;
34
+ if ( ! _pixelDesc || ! _pixelDesc->name )
35
+ throw std::runtime_error ( " unknown pixel name" );
36
+
37
+ return std::string ( _pixelDesc->name );
37
38
}
38
39
39
40
std::string PixelProperties::getPixelFormatName () const
@@ -42,7 +43,10 @@ std::string PixelProperties::getPixelFormatName() const
42
43
throw std::runtime_error ( " unable to find pixel format." );
43
44
44
45
const char * formatName = av_get_pix_fmt_name ( _pixelFormat );
45
- return formatName ? std::string ( formatName ) : " unknown pixel format" ;
46
+ if ( ! formatName )
47
+ throw std::runtime_error ( " unknown pixel format" );
48
+
49
+ return std::string ( formatName );
46
50
}
47
51
48
52
size_t PixelProperties::getBitsPerPixel () const
You can’t perform that action at this time.
0 commit comments