X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fwestwood_vqa.c;h=77df007c110ce4960b7fded5bc3f8abc1e22592d;hb=bc70684e74a185d7b80c8b80bdedda659cb581b8;hp=efb9847ff09129aca4dd48750470530ca527c6fe;hpb=217ad40aef9eeeff4e805dec3e980fb16aec3345;p=ffmpeg diff --git a/libavformat/westwood_vqa.c b/libavformat/westwood_vqa.c index efb9847ff09..77df007c110 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; } @@ -260,7 +260,7 @@ static int wsvqa_read_packet(AVFormatContext *s, return ret; } -AVInputFormat ff_wsvqa_demuxer = { +const AVInputFormat ff_wsvqa_demuxer = { .name = "wsvqa", .long_name = NULL_IF_CONFIG_SMALL("Westwood Studios VQA"), .priv_data_size = sizeof(WsVqaDemuxContext),