[FFmpeg-devel] [PATCH 2/2] Add another special case to the Cinepak video decoder so that it can handle the following file:

Michael Niedermayer michaelni at gmx.at
Wed Nov 16 15:17:22 CET 2011


On Tue, Nov 15, 2011 at 11:06:48PM -0800, mike at multimedia.cx wrote:
> From: Mike Melanson <mike at multimedia.cx>
> 
> http://samples.mplayerhq.hu/V-codecs/CVID/bad_cinepak_frame_size.mov
> 
> This fix works around another work around which handles a different type
> of odd Cinepak data.
> 
> Thanks to Matthew Hoops (clone2727 - gmail.com) for the sample and fix.
> ---
>  libavcodec/cinepak.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c
> index c5d47be..2eca87e 100644
> --- a/libavcodec/cinepak.c
> +++ b/libavcodec/cinepak.c
> @@ -330,12 +330,13 @@ static int cinepak_decode (CinepakContext *s)
>  
>      /* if this is the first frame, check for deviant Sega FILM data */
>      if (s->sega_film_skip_bytes == -1) {
> -        if (encoded_buf_size != s->size) {
> +        if (encoded_buf_size != s->size && (s->size % encoded_buf_size) != 0) {

this can cause a division by 0
ive fixed and applied it locally, ill push after tests.
Thanks

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

Dictatorship naturally arises out of democracy, and the most aggravated
form of tyranny and slavery out of the most extreme liberty. -- Plato
-------------- 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/20111116/d71f9597/attachment.asc>


More information about the ffmpeg-devel mailing list