diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index 3ffac08170..682079dd9a 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -134,9 +134,16 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx) /* load up the VQA parameters from the header */ s->vqa_version = s->avctx->extradata[0]; - if (s->vqa_version < 1 || s->vqa_version > 3) { - av_log(s->avctx, AV_LOG_ERROR, " VQA video: unsupported version %d\n", s->vqa_version); - return -1; + switch (s->vqa_version) { + case 1: + case 2: + break; + case 3: + av_log_missing_feature(avctx, "VQA Version 3", 0); + return AVERROR_PATCHWELCOME; + default: + av_log_missing_feature(avctx, "VQA Version", 1); + return AVERROR_PATCHWELCOME; } s->width = AV_RL16(&s->avctx->extradata[6]); s->height = AV_RL16(&s->avctx->extradata[8]); diff --git a/libavformat/avio.c b/libavformat/avio.c index 480dc98205..d9d417c5a9 100644 --- a/libavformat/avio.c +++ b/libavformat/avio.c @@ -359,7 +359,7 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int else usleep(1000); } else if (ret < 1) - return ret < 0 ? ret : len; + return (ret < 0 && ret != AVERROR_EOF) ? ret : len; if (ret) fast_retries = FFMAX(fast_retries, 2); len += ret; diff --git a/libavformat/westwood_vqa.c b/libavformat/westwood_vqa.c index 41dad8e8ab..d78eec3005 100644 --- a/libavformat/westwood_vqa.c +++ b/libavformat/westwood_vqa.c @@ -104,7 +104,6 @@ static int wsvqa_read_header(AVFormatContext *s, header = (unsigned char *)st->codec->extradata; if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) != VQA_HEADER_SIZE) { - av_free(st->codec->extradata); return AVERROR(EIO); } st->codec->width = AV_RL16(&header[6]);