mirror of https://github.com/mpv-player/mpv
vd_lavc: fix software decoding fallback
The string is deallocated by the callee after initialization, so
fallback at runtime passes a deallocated string to libavcodec, which
results in random crashes. Regression introduced by commit 4d016a9
.
This commit is contained in:
parent
0bad744d68
commit
2f6257e2f4
|
@ -157,7 +157,7 @@ static int init(sh_video_t *sh, const char *decoder)
|
||||||
if (hwdec) {
|
if (hwdec) {
|
||||||
AVCodec *lavc_hwcodec = avcodec_find_decoder_by_name(hwdec->hw_codec);
|
AVCodec *lavc_hwcodec = avcodec_find_decoder_by_name(hwdec->hw_codec);
|
||||||
if (lavc_hwcodec) {
|
if (lavc_hwcodec) {
|
||||||
ctx->software_fallback_decoder = decoder;
|
ctx->software_fallback_decoder = talloc_strdup(ctx, decoder);
|
||||||
decoder = lavc_hwcodec->name;
|
decoder = lavc_hwcodec->name;
|
||||||
} else {
|
} else {
|
||||||
hwdec = NULL;
|
hwdec = NULL;
|
||||||
|
|
Loading…
Reference in New Issue