[Mesa-dev] [PATCH] st/omx: don't return early in vid_enc_EncodeFrame()

Alex Deucher alexdeucher at gmail.com
Fri Apr 29 14:30:39 UTC 2016


On Fri, Apr 29, 2016 at 8:56 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Earlier commit plugged a memory leak, although it missed a pair of
> brackets. Thus we unconditionally returned even in the case of no error.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95203
> Fixes: b87856d25d1 ("st/omx: Fix resource leak on OMX_ErrorNone")
> Cc: Andy Furniss <adf.lists at gmail.com>
> Cc: Robert Foss <robert.foss at collabora.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> What an embarassing bug - missing brackets. Andy can you confirm that it
> resolves the issue ?

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>


> ---
>  src/gallium/state_trackers/omx/vid_enc.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/omx/vid_enc.c b/src/gallium/state_trackers/omx/vid_enc.c
> index de62166..5565241 100644
> --- a/src/gallium/state_trackers/omx/vid_enc.c
> +++ b/src/gallium/state_trackers/omx/vid_enc.c
> @@ -1151,9 +1151,10 @@ static OMX_ERRORTYPE vid_enc_EncodeFrame(omx_base_PortType *port, OMX_BUFFERHEAD
>     } else {
>        /* ------- load input image into video buffer ---- */
>        err = enc_LoadImage(port, buf, task->buf);
> -      if (err != OMX_ErrorNone)
> +      if (err != OMX_ErrorNone) {
>           FREE(task);
>           return err;
> +      }
>     }
>
>     /* -------------- determine picture type --------- */
> --
> 2.6.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list