Skip to content
Snippets Groups Projects
Commit 2292c521 authored by Philippe Gorley's avatar Philippe Gorley
Browse files

accel: fix crash

Change-Id: I6d478021b54efc7cece817b425aafef2d2189679
parent 5d5fb59a
Branches
No related tags found
No related merge requests found
......@@ -41,13 +41,17 @@ getFormatCb(AVCodecContext* codecCtx, const AVPixelFormat* formats)
AVPixelFormat fallback = AV_PIX_FMT_NONE;
for (int i = 0; formats[i] != AV_PIX_FMT_NONE; ++i) {
fallback = formats[i];
if (formats[i] == accel->format) {
if (accel && formats[i] == accel->format) {
return formats[i];
}
}
RING_WARN("'%s' acceleration not supported, falling back to software decoding", accel->name.c_str());
accel->name = {}; // don't use accel
if (accel) {
RING_WARN("'%s' acceleration not supported, falling back to software decoding", accel->name.c_str());
accel->name = {}; // don't use accel
} else {
RING_WARN() << "Not using hardware decoding";
}
return fallback;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment