[FFmpeg-devel] [PATCH 2/3] lavf/vividas: free the PB when get EOF

Andriy Gelman andriy.gelman at gmail.com
Thu Nov 28 15:53:14 EET 2019


On Thu, 28. Nov 21:40, Jun Zhao wrote:
> From: Jun Zhao <barryjzhao at tencent.com>
> 
> free the PB when get EOF.
> 
> Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
> ---
>  libavformat/vividas.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/libavformat/vividas.c b/libavformat/vividas.c
> index 16642c0..f354d7d 100644
> --- a/libavformat/vividas.c
> +++ b/libavformat/vividas.c
> @@ -296,8 +296,10 @@ static int track_header(VividasDemuxContext *viv, AVFormatContext *s,  uint8_t *
>      for (i=0;i<val_1;i++) {
>          int c = avio_r8(pb);
>          for (j=0;j<c;j++) {
> -            if (avio_feof(pb))
> +            if (avio_feof(pb)) {
> +                av_free(pb);
>                  return AVERROR_EOF;
> +            }
>              avio_r8(pb); // val_3
>              avio_r8(pb); // val_4
>          }

I think Michael posted same patch recently
http://ffmpeg.org/pipermail/ffmpeg-devel/2019-November/253390.html

-- 
Andriy


More information about the ffmpeg-devel mailing list