From 6a67d518d60b61ae2bd98c3948894a7be9955e8c Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 7 Jan 2020 14:55:40 +0100 Subject: avformat: Remove unnecessary av_packet_unref() Since bae8844e the packet will always be unreferenced when a demuxer returns an error, so that a lot of calls to av_packet_unref() in lots of demuxers are now redundant and can be removed. Signed-off-by: Andreas Rheinhardt Signed-off-by: Marton Balint --- libavformat/wvdec.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'libavformat/wvdec.c') diff --git a/libavformat/wvdec.c b/libavformat/wvdec.c index f2bb4c60ba..0aa581534d 100644 --- a/libavformat/wvdec.c +++ b/libavformat/wvdec.c @@ -287,25 +287,21 @@ static int wv_read_packet(AVFormatContext *s, AVPacket *pkt) memcpy(pkt->data, wc->block_header, WV_HEADER_SIZE); ret = avio_read(s->pb, pkt->data + WV_HEADER_SIZE, wc->header.blocksize); if (ret != wc->header.blocksize) { - av_packet_unref(pkt); return AVERROR(EIO); } while (!(wc->header.flags & WV_FLAG_FINAL_BLOCK)) { if ((ret = wv_read_block_header(s, s->pb)) < 0) { - av_packet_unref(pkt); return ret; } off = pkt->size; if ((ret = av_grow_packet(pkt, WV_HEADER_SIZE + wc->header.blocksize)) < 0) { - av_packet_unref(pkt); return ret; } memcpy(pkt->data + off, wc->block_header, WV_HEADER_SIZE); ret = avio_read(s->pb, pkt->data + off + WV_HEADER_SIZE, wc->header.blocksize); if (ret != wc->header.blocksize) { - av_packet_unref(pkt); return (ret < 0) ? ret : AVERROR_EOF; } } -- cgit v1.2.3