diff options
author | Anton Khirnov <anton@khirnov.net> | 2012-11-15 14:24:51 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2012-12-24 09:17:45 +0100 |
commit | 99e36ddd3ee57c38e6ca9e240ba518848487f849 (patch) | |
tree | 2350c100d6bf0a1e65f07b0805feff739368ab02 /libavcodec | |
parent | 261f0b14ed81e34a07d20cabf24f367db8fbfc54 (diff) | |
download | ffmpeg-99e36ddd3ee57c38e6ca9e240ba518848487f849.tar.gz |
ansi: do not depend on get_buffer() initializing the frame.
The background changes from 128 (used by the default/cmdutils
get_buffer()) to 0. This looks more correct.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/ansi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/ansi.c b/libavcodec/ansi.c index c2a1d83974..861d4e57e4 100644 --- a/libavcodec/ansi.c +++ b/libavcodec/ansi.c @@ -325,6 +325,11 @@ static int decode_frame(AVCodecContext *avctx, av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); return ret; } + if (!avctx->frame_number) { + memset(s->frame.data[0], 0, avctx->height * FFABS(s->frame.linesize[0])); + memset(s->frame.data[1], 0, AVPALETTE_SIZE); + } + s->frame.pict_type = AV_PICTURE_TYPE_I; s->frame.palette_has_changed = 1; memcpy(s->frame.data[1], ff_cga_palette, 16 * 4); |