[vlc-devel] [PATCH] vdummy: don't crash when used with hardware decoding

Rémi Denis-Courmont remi at remlab.net
Tue Oct 17 16:01:52 CEST 2017


Le 17 octobre 2017 15:52:20 GMT+02:00, Steve Lhomme <robux4 at videolabs.io> a écrit :
>---
>replaces https://patches.videolan.org/patch/18305/
>- use the pitch*line to determine if we can use the picture buffer
>---
> modules/video_output/vdummy.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
>diff --git a/modules/video_output/vdummy.c
>b/modules/video_output/vdummy.c
>index 40d54b9b96..f8535ca536 100644
>--- a/modules/video_output/vdummy.c
>+++ b/modules/video_output/vdummy.c
>@@ -147,7 +147,8 @@ static void DisplayStat(vout_display_t *vd,
>picture_t *picture, subpicture_t *su
> {
>     VLC_UNUSED(vd);
>     VLC_UNUSED(subpicture);
>-    if (vd->fmt.i_width*vd->fmt.i_height >= sizeof(mtime_t)) {
>+    if ( vd->fmt.i_width*vd->fmt.i_height >= sizeof(mtime_t) &&
>+         (picture->p->i_pitch * picture->p->i_lines) >=
>sizeof(mtime_t) ) {
>         mtime_t date;
>         memcpy(&date, picture->p->p_pixels, sizeof(date));
>         msg_Dbg(vd, "VOUT got %"PRIu64" ms offset",
>-- 
>2.14.2
>
>_______________________________________________
>vlc-devel mailing list
>To unsubscribe or modify your subscription options:
>https://mailman.videolan.org/listinfo/vlc-devel

LGTM
-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.


More information about the vlc-devel mailing list