mirror of https://git.ffmpeg.org/ffmpeg.git
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:
commit
3f4fb49d1b
|
@ -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]);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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]);
|
||||
|
|
Loading…
Reference in New Issue