[FFmpeg-devel] [PATCH] SDR2 demuxer
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Sun Feb 16 17:36:32 CET 2014
On Sun, Feb 16, 2014 at 03:58:35PM +0000, Paul B Mahol wrote:
> +static uint8_t header[24] = {
Should be "const".
> +static int sdr2_read_packet(AVFormatContext *s, AVPacket *pkt)
> +{
> + int64_t pos;
> + unsigned next;
> + int flags, ret = 0, is_video;
> +
> + pos = avio_tell(s->pb);
Could be assigned right at the declaration.
> + flags = avio_rl32(s->pb);
> + avio_skip(s->pb, 4);
> +
> + next = avio_rl32(s->pb);
> + if (next <= 52)
> + return AVERROR_INVALIDDATA;
> +
> + avio_skip(s->pb, 6);
> + is_video = avio_rl32(s->pb);
> + avio_skip(s->pb, 30);
Any idea what the skipped stuff contains?
> + ret = avio_read(s->pb, pkt->data + 24, next - 52);
> + if (ret < 0) {
> + av_free_packet(pkt);
> + return ret;
> + }
I think this doesn't handle short reads (0 <= ret < next - 52)
More information about the ffmpeg-devel
mailing list