Commit 58f887c8 authored by Tristan Matthews's avatar Tristan Matthews

* #29564: video: don't crash if find_stream_info failed

parent 1bce9bf8
......@@ -102,6 +102,11 @@ int VideoDecoder::setupFromVideoData()
avcodec_close(decoderCtx_);
DEBUG("Finding stream info");
if (!inputCtx_->streams[0]->info) {
ERROR("Stream info is NULL");
return -1;
}
#if LIBAVFORMAT_VERSION_INT < AV_VERSION_INT(53, 8, 0)
ret = av_find_stream_info(inputCtx_);
#else
......
......@@ -208,7 +208,7 @@ bool VideoReceiveThread::decodeFrame()
// decoding error?
if (ret == -2 and requestKeyFrameCallback_) {
WARN("VideoDecoder error, restarting it...");
videoDecoder_->setupFromVideoData();
EXIT_IF_FAIL(!videoDecoder_->setupFromVideoData(), "Setup failed");
requestKeyFrameCallback_(id_);
} else if (ret < 0) {
ERROR("VideoDecoder fatal error, stopping it...");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment