[Spice-devel] [spice-gtk PATCH 1/2] mjpeg_decoder_queue_frame: free frame when dropping the frame

Frediano Ziglio fziglio at redhat.com
Tue Apr 17 12:06:46 UTC 2018


> 
> Signed-off-by: Uri Lublin <uril at redhat.com>
> ---
>  src/channel-display-mjpeg.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/channel-display-mjpeg.c b/src/channel-display-mjpeg.c
> index 8c4c0aa..7b2f775 100644
> --- a/src/channel-display-mjpeg.c
> +++ b/src/channel-display-mjpeg.c
> @@ -262,6 +262,7 @@ static gboolean mjpeg_decoder_queue_frame(VideoDecoder
> *video_decoder,
>       * So drop late frames as early as possible to save on processing time.
>       */
>      if (latency < 0) {
> +        frame->free(frame);
>          return TRUE;
>      }
>  

Patch looks good, but I would write something more in the commit, something like:

We own the frame and we didn't add to any queue so if we don't free the
frame we are having a leak.

Frediano


More information about the Spice-devel mailing list