X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fbrstm.c;h=1470690731e52aa70552b97a754912940a4cff09;hb=ae436cc5e4d75c1a7deefb2b30820486e2f3d8af;hp=87690e3f73e421ebf870edc15ae9417bf92ff4c5;hpb=ee96ab2db507b95a694f10b152481cf71842de28;p=ffmpeg diff --git a/libavformat/brstm.c b/libavformat/brstm.c index 87690e3f73e..1470690731e 100644 --- a/libavformat/brstm.c +++ b/libavformat/brstm.c @@ -38,7 +38,7 @@ typedef struct BRSTMDemuxContext { int little_endian; } BRSTMDemuxContext; -static int probe(AVProbeData *p) +static int probe(const AVProbeData *p) { if (AV_RL32(p->buf) == MKTAG('R','S','T','M') && (AV_RL16(p->buf + 4) == 0xFFFE || @@ -47,7 +47,7 @@ static int probe(AVProbeData *p) return 0; } -static int probe_bfstm(AVProbeData *p) +static int probe_bfstm(const AVProbeData *p) { if ((AV_RL32(p->buf) == MKTAG('F','S','T','M') || AV_RL32(p->buf) == MKTAG('C','S','T','M')) && @@ -403,8 +403,8 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) (32 + 4 + size) > (INT_MAX / par->channels) || (32 + 4 + size) * par->channels > INT_MAX - 8) return AVERROR_INVALIDDATA; - if (av_new_packet(pkt, 8 + (32 + 4 + size) * par->channels) < 0) - return AVERROR(ENOMEM); + if ((ret = av_new_packet(pkt, 8 + (32 + 4 + size) * par->channels)) < 0) + return ret; dst = pkt->data; if (par->codec_id == AV_CODEC_ID_ADPCM_THP_LE) { bytestream_put_le32(&dst, size * par->channels);