X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fwestwood_vqa.c;h=a0db854b1cfd6f80621b29ed5443b2ee7c57dcac;hb=11cb635c84cd5d011abc2aade27c7498bcf29595;hp=efb9847ff09129aca4dd48750470530ca527c6fe;hpb=2ac399d7faa5ac80088715780769522d1141b549;p=ffmpeg diff --git a/libavformat/westwood_vqa.c b/libavformat/westwood_vqa.c index efb9847ff09..a0db854b1cf 100644 --- a/libavformat/westwood_vqa.c +++ b/libavformat/westwood_vqa.c @@ -62,7 +62,7 @@ typedef struct WsVqaDemuxContext { int video_stream_index; } WsVqaDemuxContext; -static int wsvqa_probe(AVProbeData *p) +static int wsvqa_probe(const AVProbeData *p) { /* need 12 bytes to qualify */ if (p->buf_size < 12) @@ -85,7 +85,7 @@ static int wsvqa_read_header(AVFormatContext *s) uint8_t scratch[VQA_PREAMBLE_SIZE]; uint32_t chunk_tag; uint32_t chunk_size; - int fps; + int fps, ret; /* initialize the video decoder stream */ st = avformat_new_stream(s, NULL); @@ -101,8 +101,8 @@ static int wsvqa_read_header(AVFormatContext *s) avio_seek(pb, 20, SEEK_SET); /* the VQA header needs to go to the decoder */ - if (ff_get_extradata(s, st->codecpar, pb, VQA_HEADER_SIZE) < 0) - return AVERROR(ENOMEM); + if ((ret = ff_get_extradata(s, st->codecpar, pb, VQA_HEADER_SIZE)) < 0) + return ret; header = st->codecpar->extradata; st->codecpar->width = AV_RL16(&header[6]); st->codecpar->height = AV_RL16(&header[8]); @@ -214,8 +214,8 @@ static int wsvqa_read_packet(AVFormatContext *s, break; case SND2_TAG: st->codecpar->codec_id = AV_CODEC_ID_ADPCM_IMA_WS; - if (ff_alloc_extradata(st->codecpar, 2)) - return AVERROR(ENOMEM); + if ((ret = ff_alloc_extradata(st->codecpar, 2)) < 0) + return ret; AV_WL16(st->codecpar->extradata, wsvqa->version); break; }