aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-01-07 14:55:42 +0100
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-07-01 22:55:52 +0200
commit57dca5213ba40e6ed5ff70782f8ecefd30915fc7 (patch)
treeedf90e05325b6dcf376b9bad5de1990228f98f77
parent88a19d6b4df69f419381fbc5690cf38e4a55f97f (diff)
downloadffmpeg-57dca5213ba40e6ed5ff70782f8ecefd30915fc7.tar.gz
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 bb20f3dd730689c3a99f7820cff8b74b06992fff) Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
-rw-r--r--libavformat/fitsdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/fitsdec.c b/libavformat/fitsdec.c
index 4b288b3903..e5f152fd68 100644
--- a/libavformat/fitsdec.c
+++ b/libavformat/fitsdec.c
@@ -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);
}