lavu/qsv: fix a random hwupload failure regression

Message ID 1538301592-26079-1-git-send-email-zhong.li@intel.com
State Committed
Commit 21733b39d0af5211d7b9f168ff3667ea86362e2b
Headers show
Series
  • lavu/qsv: fix a random hwupload failure regression
Related show

Commit Message

Li, Zhong Sept. 30, 2018, 9:59 a.m.
Variable 'ret' hasn't been initialized,thus introducing a random
hwupload failure regression due to qsv session uninitialized.

Signed-off-by: Zhong Li <zhong.li@intel.com>
---
 libavutil/hwcontext_qsv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Barbato Oct. 3, 2018, 5:56 a.m. | #1
On 30/09/2018 11:59, Zhong Li wrote:
> Variable 'ret' hasn't been initialized,thus introducing a random
> hwupload failure regression due to qsv session uninitialized.
> 
> Signed-off-by: Zhong Li <zhong.li@intel.com>
> ---
>  libavutil/hwcontext_qsv.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
> index 1887936..f550bac 100644
> --- a/libavutil/hwcontext_qsv.c
> +++ b/libavutil/hwcontext_qsv.c
> @@ -833,7 +833,7 @@ static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
>  
>      mfxSyncPoint sync = NULL;
>      mfxStatus err;
> -    int ret;
> +    int ret = 0;
>  
>      while (!s->session_upload_init && !s->session_upload && !ret) {
>  #if HAVE_PTHREADS
> 

Sounds correct, thank you for spotting it!

lu
Rogozhkin, Dmitry V Oct. 3, 2018, 4:59 p.m. | #2
On Wed, 2018-10-03 at 07:56 +0200, Luca Barbato wrote:
> On 30/09/2018 11:59, Zhong Li wrote:
> > Variable 'ret' hasn't been initialized,thus introducing a random
> > hwupload failure regression due to qsv session uninitialized.
> > 
> > Signed-off-by: Zhong Li <zhong.li@intel.com>
> > ---
> >  libavutil/hwcontext_qsv.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
> > index 1887936..f550bac 100644
> > --- a/libavutil/hwcontext_qsv.c
> > +++ b/libavutil/hwcontext_qsv.c
> > @@ -833,7 +833,7 @@ static int
> > qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
> >  
> >      mfxSyncPoint sync = NULL;
> >      mfxStatus err;
> > -    int ret;
> > +    int ret = 0;
> >  
> >      while (!s->session_upload_init && !s->session_upload && !ret)
> > {
> >  #if HAVE_PTHREADS
> > 
> 
> Sounds correct, thank you for spotting it!
> 
> lu
> _______________________________________________
> libav-devel mailing list
> libav-devel@libav.org
> https://lists.libav.org/mailman/listinfo/libav-devel

Works on my side and fixes an issue with hwupload which I saw. Can,
please, this be merged?
Luca Barbato Oct. 3, 2018, 9:36 p.m. | #3
On 03/10/2018 18:59, Rogozhkin, Dmitry V wrote:
> On Wed, 2018-10-03 at 07:56 +0200, Luca Barbato wrote:
>> On 30/09/2018 11:59, Zhong Li wrote:
>>> Variable 'ret' hasn't been initialized,thus introducing a random
>>> hwupload failure regression due to qsv session uninitialized.
>>>
>>> Signed-off-by: Zhong Li <zhong.li@intel.com>
>>> ---
>>>  libavutil/hwcontext_qsv.c | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
>>> index 1887936..f550bac 100644
>>> --- a/libavutil/hwcontext_qsv.c
>>> +++ b/libavutil/hwcontext_qsv.c
>>> @@ -833,7 +833,7 @@ static int
>>> qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
>>>  
>>>      mfxSyncPoint sync = NULL;
>>>      mfxStatus err;
>>> -    int ret;
>>> +    int ret = 0;
>>>  
>>>      while (!s->session_upload_init && !s->session_upload && !ret)
>>> {
>>>  #if HAVE_PTHREADS
>>>
>>
>> Sounds correct, thank you for spotting it!
>>
>> lu
>> _______________________________________________
>> libav-devel mailing list
>> libav-devel@libav.org
>> https://lists.libav.org/mailman/listinfo/libav-devel
> 
> Works on my side and fixes an issue with hwupload which I saw. Can,
> please, this be merged?

It should already.
Li, Zhong Oct. 8, 2018, 3:09 a.m. | #4
> From: libav-devel [mailto:libav-devel-bounces@libav.org] On Behalf Of Luca
> Barbato
> Sent: Thursday, October 4, 2018 5:36 AM
> To: libav-devel@libav.org
> Subject: Re: [libav-devel] [PATCH] lavu/qsv: fix a random hwupload failure
> regression
> 
> On 03/10/2018 18:59, Rogozhkin, Dmitry V wrote:
> > On Wed, 2018-10-03 at 07:56 +0200, Luca Barbato wrote:
> >> On 30/09/2018 11:59, Zhong Li wrote:
> >>> Variable 'ret' hasn't been initialized,thus introducing a random
> >>> hwupload failure regression due to qsv session uninitialized.
> >>>
> >>> Signed-off-by: Zhong Li <zhong.li@intel.com>
> >>> ---
> >>>  libavutil/hwcontext_qsv.c | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
> >>> index 1887936..f550bac 100644
> >>> --- a/libavutil/hwcontext_qsv.c
> >>> +++ b/libavutil/hwcontext_qsv.c
> >>> @@ -833,7 +833,7 @@ static int
> >>> qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
> >>>
> >>>      mfxSyncPoint sync = NULL;
> >>>      mfxStatus err;
> >>> -    int ret;
> >>> +    int ret = 0;
> >>>
> >>>      while (!s->session_upload_init && !s->session_upload && !ret) {
> >>>  #if HAVE_PTHREADS
> >>>
> >>
> >> Sounds correct, thank you for spotting it!
> >>
> >> lu
> >> _______________________________________________
> >> libav-devel mailing list
> >> libav-devel@libav.org
> >> https://lists.libav.org/mailman/listinfo/libav-devel
> >
> > Works on my side and fixes an issue with hwupload which I saw. Can,
> > please, this be merged?
> 
> It should already.

Thank you, Luca!

Patch

diff --git a/libavutil/hwcontext_qsv.c b/libavutil/hwcontext_qsv.c
index 1887936..f550bac 100644
--- a/libavutil/hwcontext_qsv.c
+++ b/libavutil/hwcontext_qsv.c
@@ -833,7 +833,7 @@  static int qsv_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
 
     mfxSyncPoint sync = NULL;
     mfxStatus err;
-    int ret;
+    int ret = 0;
 
     while (!s->session_upload_init && !s->session_upload && !ret) {
 #if HAVE_PTHREADS