diff mbox series

[FFmpeg-devel,04/13] avcodec/mss3: Remove unnecessary free of unallocated packet

Message ID 20200829175626.11682-4-andreas.rheinhardt@gmail.com
State Accepted
Commit c1d3b4705e2a6102416f5c53e83ad57ac6388390
Headers show
Series [FFmpeg-devel,01/13] avcodec/cinepakenc: Cleanup generically after init failure | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 29, 2020, 5:56 p.m. UTC
The packet will only be allocated a few lines below.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/mss3.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Paul B Mahol Aug. 29, 2020, 8:08 p.m. UTC | #1
On 8/29/20, Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote:
> The packet will only be allocated a few lines below.
>

You mean frame?

> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/mss3.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c
> index 113af5ba37..a301675ec2 100644
> --- a/libavcodec/mss3.c
> +++ b/libavcodec/mss3.c
> @@ -844,7 +844,6 @@ static av_cold int mss3_decode_init(AVCodecContext
> *avctx)
>                                              b_width * b_height);
>          if (!c->dct_coder[i].prev_dc) {
>              av_log(avctx, AV_LOG_ERROR, "Cannot allocate buffer\n");
> -            av_frame_free(&c->pic);
>              while (i >= 0) {
>                  av_freep(&c->dct_coder[i].prev_dc);
>                  i--;
> --
> 2.20.1
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
Andreas Rheinhardt Aug. 30, 2020, 12:22 a.m. UTC | #2
Paul B Mahol:
> On 8/29/20, Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote:
>> The packet will only be allocated a few lines below.
>>
> 
> You mean frame?
> 
Yes. Fixed locally. Thanks.

>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
>> ---
>>  libavcodec/mss3.c | 1 -
>>  1 file changed, 1 deletion(-)
>>
>> diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c
>> index 113af5ba37..a301675ec2 100644
>> --- a/libavcodec/mss3.c
>> +++ b/libavcodec/mss3.c
>> @@ -844,7 +844,6 @@ static av_cold int mss3_decode_init(AVCodecContext
>> *avctx)
>>                                              b_width * b_height);
>>          if (!c->dct_coder[i].prev_dc) {
>>              av_log(avctx, AV_LOG_ERROR, "Cannot allocate buffer\n");
>> -            av_frame_free(&c->pic);
>>              while (i >= 0) {
>>                  av_freep(&c->dct_coder[i].prev_dc);
>>                  i--;
>> --
>> 2.20.1
Paul B Mahol Aug. 30, 2020, 6:55 a.m. UTC | #3
On 8/30/20, Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote:
> Paul B Mahol:
>> On 8/29/20, Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote:
>>> The packet will only be allocated a few lines below.
>>>
>>
>> You mean frame?
>>
> Yes. Fixed locally. Thanks.

LGTM

>
>>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
>>> ---
>>>  libavcodec/mss3.c | 1 -
>>>  1 file changed, 1 deletion(-)
>>>
>>> diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c
>>> index 113af5ba37..a301675ec2 100644
>>> --- a/libavcodec/mss3.c
>>> +++ b/libavcodec/mss3.c
>>> @@ -844,7 +844,6 @@ static av_cold int mss3_decode_init(AVCodecContext
>>> *avctx)
>>>                                              b_width * b_height);
>>>          if (!c->dct_coder[i].prev_dc) {
>>>              av_log(avctx, AV_LOG_ERROR, "Cannot allocate buffer\n");
>>> -            av_frame_free(&c->pic);
>>>              while (i >= 0) {
>>>                  av_freep(&c->dct_coder[i].prev_dc);
>>>                  i--;
>>> --
>>> 2.20.1
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavcodec/mss3.c b/libavcodec/mss3.c
index 113af5ba37..a301675ec2 100644
--- a/libavcodec/mss3.c
+++ b/libavcodec/mss3.c
@@ -844,7 +844,6 @@  static av_cold int mss3_decode_init(AVCodecContext *avctx)
                                             b_width * b_height);
         if (!c->dct_coder[i].prev_dc) {
             av_log(avctx, AV_LOG_ERROR, "Cannot allocate buffer\n");
-            av_frame_free(&c->pic);
             while (i >= 0) {
                 av_freep(&c->dct_coder[i].prev_dc);
                 i--;