avformat/fitsdec: Fix potential leak of string in AVBPrint

by freeing it a bit earlier.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit bb20f3dd73)
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2020-01-07 14:55:42 +01:00
parent 88a19d6b4d
commit 57dca5213b
1 changed files with 1 additions and 1 deletions

View File

@ -157,11 +157,11 @@ static int fits_read_packet(AVFormatContext *s, AVPacket *pkt)
av_bprint_init(&avbuf, FITS_BLOCK_SIZE, AV_BPRINT_SIZE_UNLIMITED);
while ((ret = is_image(s, fits, &header, &avbuf, &size)) == 0) {
av_bprint_finalize(&avbuf, NULL);
pos = avio_skip(s->pb, size);
if (pos < 0)
return pos;
av_bprint_finalize(&avbuf, NULL);
av_bprint_init(&avbuf, FITS_BLOCK_SIZE, AV_BPRINT_SIZE_UNLIMITED);
avpriv_fits_header_init(&header, STATE_XTENSION);
}