diff options
author | wm4 <wm4@nowhere> | 2017-10-18 12:14:56 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2017-10-18 12:14:56 +0200 |
commit | 872c2403a48a02ad29b4b35926e184865c3dfe74 (patch) | |
tree | 7dbc848c12b72a0a7019c33eb2ea761bf07479d9 /player | |
parent | 14f01bd39866b9d704c7ea69f6b4c45e1350a843 (diff) | |
download | mpv-872c2403a48a02ad29b4b35926e184865c3dfe74.tar.bz2 mpv-872c2403a48a02ad29b4b35926e184865c3dfe74.tar.xz |
video: fix poitential NULL deref
Regression introduced by direct rendering code additions. Found by same
static analyzer.
Diffstat (limited to 'player')
-rw-r--r-- | player/video.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/player/video.c b/player/video.c index 03331c7828..b6a05a5929 100644 --- a/player/video.c +++ b/player/video.c @@ -319,13 +319,14 @@ int init_video_decoder(struct MPContext *mpctx, struct track *track) d_video->header = track->stream; d_video->codec = track->stream->codec; d_video->fps = d_video->header->codec->fps; - d_video->vo = mpctx->vo_chain->vo; // Note: at least mpv_opengl_cb_uninit_gl() relies on being able to get // rid of all references to the VO by destroying the VO chain. Thus, // decoders not linked to vo_chain must not use the hwdec context. - if (mpctx->vo_chain) + if (mpctx->vo_chain) { d_video->hwdec_devs = mpctx->vo_chain->hwdec_devs; + d_video->vo = mpctx->vo_chain->vo; + } MP_VERBOSE(d_video, "Container reported FPS: %f\n", d_video->fps); |