X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fcinedec.c;h=e5c6468c39154787b343186f92fe0afb42ac0d7f;hb=1ec87f50f42a16f9228444dc08aa8264879f61e1;hp=de34fb963820188a8c9965263978cb4a408d33d9;hpb=f3881c04e93ee70567bd3fe087f49b996b026d30;p=ffmpeg diff --git a/libavformat/cinedec.c b/libavformat/cinedec.c index de34fb96382..e5c6468c391 100644 --- a/libavformat/cinedec.c +++ b/libavformat/cinedec.c @@ -56,7 +56,7 @@ enum { #define CFA_BLGRAY 0x20000000U #define CFA_BRGRAY 0x10000000U -static int cine_read_probe(AVProbeData *p) +static int cine_read_probe(const AVProbeData *p) { int HeaderSize; if (p->buf[0] == 'C' && p->buf[1] == 'I' && // Type @@ -168,6 +168,10 @@ static int cine_read_header(AVFormatContext *avctx) avio_skip(pb, 616); // Binning .. bFlipH if (!avio_rl32(pb) ^ vflip) { st->codecpar->extradata = av_strdup("BottomUp"); + if (!st->codecpar->extradata) { + st->codecpar->extradata_size = 0; + return AVERROR(ENOMEM); + } st->codecpar->extradata_size = 9; } @@ -284,10 +288,10 @@ static int cine_read_packet(AVFormatContext *avctx, AVPacket *pkt) AVIOContext *pb = avctx->pb; int n, size, ret; - if (cine->pts >= st->duration) + if (cine->pts >= st->internal->nb_index_entries) return AVERROR_EOF; - avio_seek(pb, st->index_entries[cine->pts].pos, SEEK_SET); + avio_seek(pb, st->internal->index_entries[cine->pts].pos, SEEK_SET); n = avio_rl32(pb); if (n < 8) return AVERROR_INVALIDDATA;