From 37a43cfb3921a0b80157ea658d408bd08ab68306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Axelsson?= Date: Thu, 12 Feb 2009 01:27:56 +0000 Subject: [PATCH] =?UTF-8?q?Set=20AVSubtitle=20format=20to=200.=20Neither?= =?UTF-8?q?=20dvdsubdec=20nor=20xsubdec=20intializes=20format=20to=200,=20?= =?UTF-8?q?but=20ffplay=20checks=20it=20before=20displaying=20subtitles=20?= =?UTF-8?q?(ffplay.c:1437).=20patch=20by=20Bj=C3=B6rn=20Axelsson,=20gecko?= =?UTF-8?q?=20acc.umu=20se?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Originally committed as revision 17170 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/dvdsubdec.c | 1 + libavcodec/xsubdec.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 31e7a47b00..9691e384f4 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -175,6 +175,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header, return -1; sub_header->rects = NULL; sub_header->num_rects = 0; + sub_header->format = 0; sub_header->start_display_time = 0; sub_header->end_display_time = 0; diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index 0274705fb2..35b00a54b4 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -51,6 +51,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, int w, h, x, y, rlelen, i; GetBitContext gb; + sub->format = 0; + // check that at least header fits if (buf_size < 27 + 7 * 2 + 4 * 3) { av_log(avctx, AV_LOG_ERROR, "coded frame too small\n");