Don't panic on OOM

This commit is contained in:
Kornel Lesiński 2020-07-02 02:41:47 +01:00 committed by Zhiming Wang
parent f0903fb69b
commit 50e1ccaca4
No known key found for this signature in database
GPG Key ID: 5B58F95EC95965D8

View File

@ -77,7 +77,7 @@ impl Output {
let ptr = avformat_new_stream(self.as_mut_ptr(), codec);
if ptr.is_null() {
panic!("out of memory");
return Err(Error::Unknown);
}
let index = (*self.ctx.as_ptr()).nb_streams - 1;