[FFmpeg-devel] [PATCH] SDR2 demuxer
Michael Niedermayer
michaelni at gmx.at
Fri Feb 21 01:39:01 CET 2014
On Tue, Feb 18, 2014 at 03:58:05PM +0100, Paul B Mahol wrote:
> On 2/16/14, Reimar Doeffinger <Reimar.Doeffinger at gmx.de> wrote:
> > On Sun, Feb 16, 2014 at 03:58:35PM +0000, Paul B Mahol wrote:
> >> +static uint8_t header[24] = {
> >
> > Should be "const".
>
> fixed locally.
>
> >
> >> +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)
>
> fixed locally.
rest of the patch LGTM
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
It is what and why we do it that matters, not just one of them.
-------------- 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/20140221/2ff0512c/attachment.asc>
More information about the ffmpeg-devel
mailing list