ffmpeg | branch: master | Andreas Rheinhardt <[email protected]> | 
Thu May 13 22:06:02 2021 +0200| [6ff2aba08811876bfdc3c7df6f73f47f27b93803] | 
committer: Andreas Rheinhardt

avformat/utils: Fix NPD when allocating AVStreamInternal fails

Regression since b9c5fdf6027010d15ee90a43aa023e45a5189097;
fixes Coverity ID #1484786.

Also remove the check for st->internal->parser as av_parser_close(NULL)
is a no-op.

Reviewed-by: James Almer <[email protected]>
Reviewed-by: Marton Balint <[email protected]>
Signed-off-by: Andreas Rheinhardt <[email protected]>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=6ff2aba08811876bfdc3c7df6f73f47f27b93803
---

 libavformat/utils.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 492e08562e..fe8eaa6cb3 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -4262,13 +4262,11 @@ static void free_stream(AVStream **pst)
         av_freep(&st->side_data[i].data);
     av_freep(&st->side_data);
 
-    if (st->internal->parser)
-        av_parser_close(st->internal->parser);
-
     if (st->attached_pic.data)
         av_packet_unref(&st->attached_pic);
 
     if (st->internal) {
+        av_parser_close(st->internal->parser);
         avcodec_free_context(&st->internal->avctx);
         av_bsf_free(&st->internal->bsfc);
         av_freep(&st->internal->priv_pts);

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to