Mercurial > libavcodec.hg
comparison dvdsubdec.c @ 4437:42ad7d63fb5d libavcodec
Fix a bug in the DVD subtitle decoder where subtitles with odd heights would not
have the last line decoded, leaving the bottom line of the bitmap array
uninitialised. Patch by Ian Caulfield, ian dot caulfield gmail dot com.
author | takis |
---|---|
date | Tue, 30 Jan 2007 14:19:43 +0000 |
parents | 3c00eb82db0d |
children | fe3179006730 |
comparison
equal
deleted
inserted
replaced
4436:d3e389536b0a | 4437:42ad7d63fb5d |
---|---|
247 | 247 |
248 bitmap = av_malloc(w * h); | 248 bitmap = av_malloc(w * h); |
249 sub_header->rects = av_mallocz(sizeof(AVSubtitleRect)); | 249 sub_header->rects = av_mallocz(sizeof(AVSubtitleRect)); |
250 sub_header->num_rects = 1; | 250 sub_header->num_rects = 1; |
251 sub_header->rects[0].rgba_palette = av_malloc(4 * 4); | 251 sub_header->rects[0].rgba_palette = av_malloc(4 * 4); |
252 decode_rle(bitmap, w * 2, w, h / 2, | 252 decode_rle(bitmap, w * 2, w, (h + 1) / 2, |
253 buf, offset1 * 2, buf_size); | 253 buf, offset1 * 2, buf_size); |
254 decode_rle(bitmap + w, w * 2, w, h / 2, | 254 decode_rle(bitmap + w, w * 2, w, h / 2, |
255 buf, offset2 * 2, buf_size); | 255 buf, offset2 * 2, buf_size); |
256 guess_palette(sub_header->rects[0].rgba_palette, | 256 guess_palette(sub_header->rects[0].rgba_palette, |
257 palette, alpha, 0xffff00); | 257 palette, alpha, 0xffff00); |