Skip to content
Snippets Groups Projects
Commit 56a78bfb authored by Philippe Gorley's avatar Philippe Gorley Committed by Adrien Béraud
Browse files

accel: don't crash on fallback

If no accel is found in getFormatCb, accel->codecCtx_ is null, and
segfaults.

Change-Id: Ibe3b246aaa0620f2dd5b91d2864fff65b6e8b794
parent 04ee614f
Branches
Tags
No related merge requests found
...@@ -116,10 +116,12 @@ HardwareAccel::fail(bool forceFallback) ...@@ -116,10 +116,12 @@ HardwareAccel::fail(bool forceFallback)
fallback_ = true; fallback_ = true;
allocationFails_ = 0; allocationFails_ = 0;
extractionFails_ = 0; extractionFails_ = 0;
if (codecCtx_) {
codecCtx_->get_format = avcodec_default_get_format; codecCtx_->get_format = avcodec_default_get_format;
codecCtx_->get_buffer2 = avcodec_default_get_buffer2; codecCtx_->get_buffer2 = avcodec_default_get_buffer2;
} }
} }
}
bool bool
HardwareAccel::extractData(VideoFrame& input) HardwareAccel::extractData(VideoFrame& input)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment