diff mbox series

[FFmpeg-devel,5/8] avcodec/jpeglsenc: Remove redundant av_packet_unref()

Message ID 20200904231716.16182-5-andreas.rheinhardt@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,1/8] avcodec/jpeglsenc: Don't use put bits API for byte-aligned writes | expand

Checks

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

Commit Message

Andreas Rheinhardt Sept. 4, 2020, 11:17 p.m. UTC
If encoding fails, the AVPacket that ought to contain the encoded packet
is already unreferenced generically.

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

Comments

Paul B Mahol Sept. 5, 2020, 8:36 a.m. UTC | #1
On Sat, Sep 05, 2020 at 01:17:13AM +0200, Andreas Rheinhardt wrote:
> If encoding fails, the AVPacket that ought to contain the encoded packet
> is already unreferenced generically.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/jpeglsenc.c | 1 -
>  1 file changed, 1 deletion(-)
> 

lgtm

> diff --git a/libavcodec/jpeglsenc.c b/libavcodec/jpeglsenc.c
> index d05fe4564b..b1e54431e9 100644
> --- a/libavcodec/jpeglsenc.c
> +++ b/libavcodec/jpeglsenc.c
> @@ -431,7 +431,6 @@ FF_ENABLE_DEPRECATION_WARNINGS
>      return 0;
>  
>  memfail:
> -    av_packet_unref(pkt);
>      av_freep(&buf2);
>      av_freep(&state);
>      av_freep(&last);
> -- 
> 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/jpeglsenc.c b/libavcodec/jpeglsenc.c
index d05fe4564b..b1e54431e9 100644
--- a/libavcodec/jpeglsenc.c
+++ b/libavcodec/jpeglsenc.c
@@ -431,7 +431,6 @@  FF_ENABLE_DEPRECATION_WARNINGS
     return 0;
 
 memfail:
-    av_packet_unref(pkt);
     av_freep(&buf2);
     av_freep(&state);
     av_freep(&last);