diff mbox series

[FFmpeg-devel,6/9] avfilter/vf_subtitles: Remove unnecessary initialization of AVPacket

Message ID 20200910214901.25401-6-andreas.rheinhardt@gmail.com
State Accepted
Commit e65897f3eec371719768698fdee415db446e4311
Headers show
Series [FFmpeg-devel,1/9] avfilter/lavfutils: Don't use uninitialized pointers for freeing | 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. 10, 2020, 9:48 p.m. UTC
av_read_frame() can handle uninitialized packets.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavfilter/vf_subtitles.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Paul B Mahol Sept. 11, 2020, 9:16 a.m. UTC | #1
On Thu, Sep 10, 2020 at 11:48:58PM +0200, Andreas Rheinhardt wrote:
> av_read_frame() can handle uninitialized packets.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavfilter/vf_subtitles.c | 3 ---
>  1 file changed, 3 deletions(-)
> 

probably ok

> diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c
> index 2d3145bf2d..a045375b2d 100644
> --- a/libavfilter/vf_subtitles.c
> +++ b/libavfilter/vf_subtitles.c
> @@ -449,9 +449,6 @@ static av_cold int init_subtitles(AVFilterContext *ctx)
>          ass_process_codec_private(ass->track,
>                                    dec_ctx->subtitle_header,
>                                    dec_ctx->subtitle_header_size);
> -    av_init_packet(&pkt);
> -    pkt.data = NULL;
> -    pkt.size = 0;
>      while (av_read_frame(fmt, &pkt) >= 0) {
>          int i, got_subtitle;
>          AVSubtitle sub = {0};
> -- 
> 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".
Nicolas George Sept. 11, 2020, 9:20 a.m. UTC | #2
Andreas Rheinhardt (12020-09-10):
> av_read_frame() can handle uninitialized packets.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavfilter/vf_subtitles.c | 3 ---
>  1 file changed, 3 deletions(-)

LGTM.

Regards,
diff mbox series

Patch

diff --git a/libavfilter/vf_subtitles.c b/libavfilter/vf_subtitles.c
index 2d3145bf2d..a045375b2d 100644
--- a/libavfilter/vf_subtitles.c
+++ b/libavfilter/vf_subtitles.c
@@ -449,9 +449,6 @@  static av_cold int init_subtitles(AVFilterContext *ctx)
         ass_process_codec_private(ass->track,
                                   dec_ctx->subtitle_header,
                                   dec_ctx->subtitle_header_size);
-    av_init_packet(&pkt);
-    pkt.data = NULL;
-    pkt.size = 0;
     while (av_read_frame(fmt, &pkt) >= 0) {
         int i, got_subtitle;
         AVSubtitle sub = {0};