[FFmpeg-devel] [PATCH] rmdec: validate block alignment

Michael Niedermayer michael at niedermayer.cc
Fri Nov 18 03:44:42 EET 2016


On Thu, Nov 17, 2016 at 10:52:30PM +0100, Andreas Cadhalpun wrote:
> This fixes division by zero crashes.
> 
> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> ---
>  libavformat/rmdec.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
> index d175862..4d56529 100644
> --- a/libavformat/rmdec.c
> +++ b/libavformat/rmdec.c
> @@ -934,6 +934,10 @@ ff_rm_parse_packet (AVFormatContext *s, AVIOContext *pb,
>  
>               ast->sub_packet_cnt = 0;
>               rm->audio_stream_num = st->index;
> +            if (st->codecpar->block_align <= 0) {
> +                av_log(s, AV_LOG_ERROR, "Invalid block alignment %d\n", st->codecpar->block_align);
> +                return AVERROR_INVALIDDATA;
> +            }
>               rm->audio_pkt_cnt = h * w / st->codecpar->block_align;

indention looks odd
also i think this is already checked in rm_read_audio_stream_info() is
that check somehow broken ?

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

Does the universe only have a finite lifespan? No, its going to go on
forever, its just that you wont like living in it. -- Hiranya Peiri
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161118/2dbd0622/attachment.sig>


More information about the ffmpeg-devel mailing list