Re: [PATCH spice-gtk 4/7] gst: fix potential null pointer dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



CC'ing Francois

----- Original Message -----
> CC       channel-display-gst.lo
> channel-display-gst.c: In function ‘new_sample’:
> channel-display-gst.c:192:31: error: potential null pointer dereference
> [-Werror=null-dereference]
>                  frame->sample = sample;
>                  ~~~~~~~~~~~~~~^~~~~~~~
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@xxxxxxxxx>
> ---
>  src/channel-display-gst.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
> index 46a85ea..f162078 100644
> --- a/src/channel-display-gst.c
> +++ b/src/channel-display-gst.c
> @@ -189,8 +189,11 @@ static GstFlowReturn new_sample(GstAppSink *gstappsink,
> gpointer video_decoder)
>                  }
>  
>                  /* The frame is now ready for display */
> -                frame->sample = sample;
> -                g_queue_push_tail(decoder->display_queue, frame);
> +                if (frame) {
> +                    frame->sample = sample;
> +                    g_queue_push_tail(decoder->display_queue, frame);
> +                }
> +
>                  break;
>              }
>              l = l->next;
> --
> 2.7.4
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
> 
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]