[FFmpeg-devel] [PATCH] aiffdec: fix division by zero
Michael Niedermayer
michael at niedermayer.cc
Fri Oct 21 02:32:54 EEST 2016
On Thu, Oct 20, 2016 at 08:11:19PM +0200, Andreas Cadhalpun wrote:
> On 20.10.2016 02:56, Michael Niedermayer wrote:
> > On Wed, Oct 19, 2016 at 09:18:51PM +0200, Andreas Cadhalpun wrote:
> >> This is similar to commit c143a9c.
> >>
> >> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> >> ---
> >> libavformat/aiffdec.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > can aiff work without block_align ?
>
> Well, it can use a fall-back value. That value can be wrong, of course.
>
> > either way, block_duration is from the header reading
> > if its still accurate then using it together with 1 instead of the
> > matching block align is quite likely not correct
> > OTOH if block_duration does not represent the actual content then
> > the duration would only be correct by pure chance
> >
> > Its a bit unfortunate that theres no usecase with an undamaged sample
> > which would have clear correct values
> >
> > one has to work on the assumptation of a use case where the user needs
> > to override the codec and then ask "what is correct to do" that makes
> > this a bit tricky ...
>
> Alternatively aiff_read_packet could just error out, if you prefer that.
> Patch doing that attached.
>
> Best regards,
> Andreas
>
> aiffdec.c | 5 +++++
> 1 file changed, 5 insertions(+)
> 2fb78e5573b52b635b5077a265a54542e054cf02 0001-aiff-check-block_align-in-aiff_read_packet.patch
> From d1edb842a886de0bae6e32ac602f2fef6810081a Mon Sep 17 00:00:00 2001
> From: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
> Date: Thu, 20 Oct 2016 20:08:15 +0200
> Subject: [PATCH] aiff: check block_align in aiff_read_packet
>
> It can be unset in avcodec_parameters_from_context and a value of 0
> causes SIGFPE crashes.
LGTM
thx
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Those who are best at talking, realize last or never when they are wrong.
-------------- 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/20161021/3aa2e9cc/attachment.sig>
More information about the ffmpeg-devel
mailing list