Merge commit '26589aa81028f42c763c5581a1486a271799890b' into release/0.10
* commit '26589aa81028f42c763c5581a1486a271799890b': westwood_vqa: do not free extradata on error in read_header vqavideo: check the version rmdec: Use the AVIOContext given as parameter in rm_read_metadata() avio: Handle AVERROR_EOF in the same way as the return value 0 Conflicts: libavcodec/vqavideo.c libavformat/westwood_vqa.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -134,9 +134,16 @@ static av_cold int vqa_decode_init(AVCodecContext *avctx)
|
|||||||
|
|
||||||
/* load up the VQA parameters from the header */
|
/* load up the VQA parameters from the header */
|
||||||
s->vqa_version = s->avctx->extradata[0];
|
s->vqa_version = s->avctx->extradata[0];
|
||||||
if (s->vqa_version < 1 || s->vqa_version > 3) {
|
switch (s->vqa_version) {
|
||||||
av_log(s->avctx, AV_LOG_ERROR, " VQA video: unsupported version %d\n", s->vqa_version);
|
case 1:
|
||||||
return -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->width = AV_RL16(&s->avctx->extradata[6]);
|
||||||
s->height = AV_RL16(&s->avctx->extradata[8]);
|
s->height = AV_RL16(&s->avctx->extradata[8]);
|
||||||
|
@@ -359,7 +359,7 @@ static inline int retry_transfer_wrapper(URLContext *h, unsigned char *buf, int
|
|||||||
else
|
else
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
} else if (ret < 1)
|
} else if (ret < 1)
|
||||||
return ret < 0 ? ret : len;
|
return (ret < 0 && ret != AVERROR_EOF) ? ret : len;
|
||||||
if (ret)
|
if (ret)
|
||||||
fast_retries = FFMAX(fast_retries, 2);
|
fast_retries = FFMAX(fast_retries, 2);
|
||||||
len += ret;
|
len += ret;
|
||||||
|
@@ -104,7 +104,6 @@ static int wsvqa_read_header(AVFormatContext *s,
|
|||||||
header = (unsigned char *)st->codec->extradata;
|
header = (unsigned char *)st->codec->extradata;
|
||||||
if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) !=
|
if (avio_read(pb, st->codec->extradata, VQA_HEADER_SIZE) !=
|
||||||
VQA_HEADER_SIZE) {
|
VQA_HEADER_SIZE) {
|
||||||
av_free(st->codec->extradata);
|
|
||||||
return AVERROR(EIO);
|
return AVERROR(EIO);
|
||||||
}
|
}
|
||||||
st->codec->width = AV_RL16(&header[6]);
|
st->codec->width = AV_RL16(&header[6]);
|
||||||
|
Reference in New Issue
Block a user