summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-02-21 21:53:10 +0100
committerwm4 <wm4@nowhere>2013-02-21 21:53:10 +0100
commit2f6257e2f40a0f559b20cc2989778c6805e892fa (patch)
treeab6411f333899df94aa9cc91a93df35603b7bfde
parent0bad744d68a0ac066c5e648c8fd1673d1459478f (diff)
downloadmpv-2f6257e2f40a0f559b20cc2989778c6805e892fa.tar.bz2
mpv-2f6257e2f40a0f559b20cc2989778c6805e892fa.tar.xz
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.
-rw-r--r--video/decode/vd_lavc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/decode/vd_lavc.c b/video/decode/vd_lavc.c
index 9a8aa41888..4f99a00603 100644
--- a/video/decode/vd_lavc.c
+++ b/video/decode/vd_lavc.c
@@ -157,7 +157,7 @@ static int init(sh_video_t *sh, const char *decoder)
if (hwdec) {
AVCodec *lavc_hwcodec = avcodec_find_decoder_by_name(hwdec->hw_codec);
if (lavc_hwcodec) {
- ctx->software_fallback_decoder = decoder;
+ ctx->software_fallback_decoder = talloc_strdup(ctx, decoder);
decoder = lavc_hwcodec->name;
} else {
hwdec = NULL;