[FFmpeg-devel] [PATCH] DCX demuxer

Michael Niedermayer michaelni at gmx.at
Thu Oct 18 02:28:24 CEST 2012


On Thu, Oct 11, 2012 at 01:14:07PM +0000, Paul B Mahol wrote:
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---

> Last frame never appears when using pipes.
[...]
> +static int dcx_read_packet(AVFormatContext *s, AVPacket *pkt)
> +{
> +    DCXDemuxContext *dc = s->priv_data;
> +    int size, ret;
> +
> +    if (dc->current_frame >= s->streams[0]->nb_frames)
> +        return AVERROR_EOF;
> +    size = dc->frame_offsets[dc->current_frame + 1] -
> +           dc->frame_offsets[dc->current_frame];
> +    if (size < 0)
> +        size = INT_MAX;
> +
> +    ret = av_get_packet(s->pb, pkt, size);

dont try to read INT_MAX sized packets

otherwise LGTM

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Republics decline into democracies and democracies degenerate into
despotisms. -- Aristotle
-------------- 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/20121018/89870c4e/attachment.asc>


More information about the ffmpeg-devel mailing list