X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Ffitsdec.c;h=e52ddc7e790655b5e82989fee5fe8277718e0652;hb=82f9eb6f6c7165a404426bee8a61aac76508a177;hp=4b288b3903939f01c8c4e6c25e9a50b721ae4b1a;hpb=5ab44ff20cdc0e05adecbd0cd352d25fcb930094;p=ffmpeg diff --git a/libavformat/fitsdec.c b/libavformat/fitsdec.c index 4b288b39039..e52ddc7e790 100644 --- a/libavformat/fitsdec.c +++ b/libavformat/fitsdec.c @@ -39,7 +39,7 @@ typedef struct FITSContext { int64_t pts; } FITSContext; -static int fits_probe(AVProbeData *p) +static int fits_probe(const AVProbeData *p) { const uint8_t *b = p->buf; if (!memcmp(b, "SIMPLE = T", 30)) @@ -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); } @@ -183,7 +183,6 @@ static int fits_read_packet(AVFormatContext *s, AVPacket *pkt) ret = av_bprint_finalize(&avbuf, &buf); if (ret < 0) { - av_packet_unref(pkt); return ret; } @@ -192,7 +191,6 @@ static int fits_read_packet(AVFormatContext *s, AVPacket *pkt) av_freep(&buf); ret = avio_read(s->pb, pkt->data + pkt->size, size); if (ret < 0) { - av_packet_unref(pkt); return ret; }