[FFmpeg-devel] [PATCH 4/8] Prevent the RM demuxer from returning uninitialized AVPacket in case of corrupted streams.
Laurent Aimar
fenrir at elivagar.org
Sat Sep 17 21:25:53 CEST 2011
On Sat, Sep 17, 2011 at 04:56:32PM +0200, fenrir at elivagar.org wrote:
> From: Laurent Aimar <fenrir at videolan.org>
>
> ---
> libavformat/rmdec.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
> index 02ff7e9..1c96573 100644
> --- a/libavformat/rmdec.c
> +++ b/libavformat/rmdec.c
> @@ -764,6 +764,8 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
> ast->sub_packet_cnt = 0;
> rm->audio_stream_num = st->index;
> rm->audio_pkt_cnt = h * w / st->codec->block_align;
> + if (rm->audio_pkt_cnt <= 0)
> + return -1;
> } else if ((ast->deint_id == DEINT_ID_VBRF) ||
> (ast->deint_id == DEINT_ID_VBRS)) {
> int x;
I will provide a better patch (including the remarks I got) once
the other patches on RM are applied.
--
fenrir
More information about the ffmpeg-devel
mailing list