[vlc-commits] video_output: avoid potential NULL dereference of displayed.current
Steve Lhomme
git at videolan.org
Tue Jan 19 12:29:46 UTC 2021
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue Nov 17 14:44:40 2020 +0100| [b460c38801c377c0dc731a0ee55995ba2fefeb86] | committer: Steve Lhomme
video_output: avoid potential NULL dereference of displayed.current
ThreadDisplayPreparePicture() can call ThreadChangeFilters() which will reset
displayed.current (via ThreadFilterFlush) so we need to ensure we don't release
it again after a call to ThreadDisplayPreparePicture().
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b460c38801c377c0dc731a0ee55995ba2fefeb86
---
src/video_output/video_output.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c
index 350a3e76c6..93c3d50c75 100644
--- a/src/video_output/video_output.c
+++ b/src/video_output/video_output.c
@@ -1493,7 +1493,8 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
ThreadDisplayPreparePicture(vout, false, true, &paused);
}
- picture_Release(sys->displayed.current);
+ if (likely(sys->displayed.current != NULL))
+ picture_Release(sys->displayed.current);
sys->displayed.current = sys->displayed.next;
sys->displayed.next = NULL;
@@ -1549,7 +1550,8 @@ static int ThreadDisplayPicture(vout_thread_sys_t *vout, vlc_tick_t *deadline)
dropped_current_frame = true;
render_now = false;
- picture_Release(sys->displayed.current);
+ if (likely(sys->displayed.current != NULL))
+ picture_Release(sys->displayed.current);
sys->displayed.current = sys->displayed.next;
sys->displayed.next = NULL;
}
More information about the vlc-commits
mailing list