[FFmpeg-devel] [PATCH 5/6] Phantom Cine demuxer

Michael Niedermayer michaelni at gmx.at
Sun Feb 23 21:05:35 CET 2014


On Sat, Feb 22, 2014 at 11:42:07PM +1100, Peter Ross wrote:
[...]
> +static int cine_read_probe(AVProbeData *p)
> +{
> +    int HeaderSize;
> +    if (p->buf[0] == 'C' && p->buf[1] == 'I' &&  // Type
> +        (HeaderSize = AV_RL16(p->buf + 2)) >= 0x2C &&  // HeaderSize
> +        AV_RL32(p->buf + 20) &&                  // ImageCount
> +        AV_RL32(p->buf + 24) >= HeaderSize &&    // OffImageHeader
> +        AV_RL32(p->buf + 28) >= HeaderSize &&    // OffSetup
> +        AV_RL32(p->buf + 32) >= HeaderSize)      // OffImageOffsets
> +        return AVPROBE_SCORE_MAX;
> +    return 0;
> +}

fails
tools/probetest 128


> +
> +static int set_metadata_int(AVDictionary **dict, const char *key, int value)
> +{
> +    if (value) {
> +        char buf[64];
> +        snprintf(buf, sizeof(buf - 1), "%i", value);
> +        buf[sizeof(buf) - 1] = 0;
> +        return av_dict_set(dict, key, buf, 0);
> +    }
> +    return 0;
> +}
> +
> +static int cine_read_header(AVFormatContext *avctx)
> +{
> +    AVIOContext *pb = avctx->pb;
> +    AVStream *st;
> +    unsigned int version, compression, offImageHeader, offSetup, offImageOffsets, biBitCount, length, CFA;
> +    char *description;
> +    uint64_t i;
> +
> +    st = avformat_new_stream(avctx, NULL);
> +    if (!st)
> +        return AVERROR(ENOMEM);
> +    st->codec->codec_type = AVMEDIA_TYPE_VIDEO;

> +    st->codec->codec_id   = CODEC_ID_RAWVIDEO;

should be AV_CODEC_ID

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

If a bugfix only changes things apparently unrelated to the bug with no
further explanation, that is a good sign that the bugfix is wrong.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140223/c23d32ff/attachment.asc>


More information about the ffmpeg-devel mailing list