]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Fix a bug in the DVD subtitle decoder where subtitles with odd heights would not
authortakis <takis@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 30 Jan 2007 14:19:43 +0000 (14:19 +0000)
committertakis <takis@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Tue, 30 Jan 2007 14:19:43 +0000 (14:19 +0000)
have the last line decoded, leaving the bottom line of the bitmap array
uninitialised. Patch by Ian Caulfield, ian dot caulfield gmail dot com.

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@7767 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/dvdsubdec.c

index 9a0dd7756d25bc56b25572aa2d41824301934798..ea57a8ac2f348c0b39e676bdae5d407e4854b9e8 100644 (file)
@@ -249,7 +249,7 @@ static int decode_dvd_subtitles(AVSubtitle *sub_header,
                 sub_header->rects = av_mallocz(sizeof(AVSubtitleRect));
                 sub_header->num_rects = 1;
                 sub_header->rects[0].rgba_palette = av_malloc(4 * 4);
-                decode_rle(bitmap, w * 2, w, h / 2,
+                decode_rle(bitmap, w * 2, w, (h + 1) / 2,
                            buf, offset1 * 2, buf_size);
                 decode_rle(bitmap + w, w * 2, w, h / 2,
                            buf, offset2 * 2, buf_size);