[FFmpeg-devel] [PATCH 2/7] ansi: fix uninitialized height/width case.

Michael Niedermayer michaelni at gmx.at
Fri Sep 2 04:00:31 CEST 2011


On Thu, Sep 01, 2011 at 02:30:19AM +0200, Clément Bœsch wrote:
> ---
>  libavcodec/ansi.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c
> index ebcc288..8baaec3 100644
> --- a/libavcodec/ansi.c
> +++ b/libavcodec/ansi.c
> @@ -159,7 +159,7 @@ static void draw_char(AVCodecContext *avctx, int c)
>  static int execute_code(AVCodecContext * avctx, int c)
>  {
>      AnsiContext *s = avctx->priv_data;
> -    int ret, i, width, height;
> +    int ret, i, width = 0, height = 0;
>      switch(c) {
>      case 'A': //Cursor Up
>          s->y = FFMAX(s->y - (s->nb_args > 0 ? s->args[0]*s->font_height : s->font_height), 0);
> @@ -218,6 +218,8 @@ static int execute_code(AVCodecContext * avctx, int c)
>          default:
>              av_log_ask_for_sample(avctx, "unsupported screen mode\n");
>          }
> +        if (!width && !height)
> +            break;

LGTM, if peter has no comments / is too busy to review

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

The educated differ from the uneducated as much as the living from the
dead. -- 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/20110902/34a9d322/attachment.asc>


More information about the ffmpeg-devel mailing list