[FFmpeg-devel] [PATCH] SDR2 demuxer
Paul B Mahol
onemda at gmail.com
Tue Feb 18 15:58:05 CET 2014
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.
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
More information about the ffmpeg-devel
mailing list