X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fc93.c;h=256b9800cafbea59713ef815350362158db9626c;hb=963d4b76debd3b7577a8e35fb40662974d52fe28;hp=b1a245a3cfe866f9882b52431ac69191e7747055;hpb=50ae1f7e0ff1fa00236622415039f7e28d919a25;p=ffmpeg diff --git a/libavformat/c93.c b/libavformat/c93.c index b1a245a3cfe..256b9800caf 100644 --- a/libavformat/c93.c +++ b/libavformat/c93.c @@ -43,7 +43,7 @@ typedef struct C93DemuxContext { AVStream *audio; } C93DemuxContext; -static int probe(AVProbeData *p) +static int probe(const AVProbeData *p) { int i; int index = 1; @@ -158,22 +158,19 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) ret = avio_read(pb, pkt->data + 1, datasize); if (ret < datasize) { - ret = AVERROR(EIO); - goto fail; + return AVERROR(EIO); } datasize = avio_rl16(pb); /* palette size */ if (datasize) { if (datasize != 768) { av_log(s, AV_LOG_ERROR, "invalid palette size %u\n", datasize); - ret = AVERROR_INVALIDDATA; - goto fail; + return AVERROR_INVALIDDATA; } pkt->data[0] |= C93_HAS_PALETTE; ret = avio_read(pb, pkt->data + pkt->size, datasize); if (ret < datasize) { - ret = AVERROR(EIO); - goto fail; + return AVERROR(EIO); } pkt->size += 768; } @@ -186,10 +183,6 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) pkt->data[0] |= C93_FIRST_FRAME; } return 0; - - fail: - av_packet_unref(pkt); - return ret; } AVInputFormat ff_c93_demuxer = {