Changeset 5a1addd7 in ffmpeg
- Timestamp:
- Jan 7, 2015, 12:51:30 PM (10 years ago)
- Branches:
- master
- Children:
- 3ed80bd9, 71ec3d36
- Parents:
- 01168bf1
- git-author:
- Alexandre Colucci <alexandre@elgato.com> (01/07/15 11:18:08)
- git-committer:
- Luca Barbato <lu_zero@gentoo.org> (01/07/15 12:51:30)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libavcodec/xsubdec.c
r01168bf1 r5a1addd7 57 57 int64_t packet_time = 0; 58 58 GetBitContext gb; 59 int has_alpha = avctx->codec_tag == MKTAG('D','X','S','A'); 59 60 60 61 memset(sub, 0, sizeof(*sub)); 61 62 62 63 // check that at least header fits 63 if (buf_size < 27 + 7 * 2 + 4 * 3) {64 if (buf_size < 27 + 7 * 2 + 4 * (3 + has_alpha)) { 64 65 av_log(avctx, AV_LOG_ERROR, "coded frame too small\n"); 65 66 return -1; … … 108 109 for (i = 0; i < sub->rects[0]->nb_colors; i++) 109 110 ((uint32_t*)sub->rects[0]->pict.data[1])[i] = bytestream_get_be24(&buf); 110 // make all except background (first entry) non-transparent 111 for (i = 1; i < sub->rects[0]->nb_colors; i++) 112 ((uint32_t*)sub->rects[0]->pict.data[1])[i] |= 0xff000000; 111 112 if (!has_alpha) { 113 // make all except background (first entry) non-transparent 114 for (i = 1; i < sub->rects[0]->nb_colors; i++) 115 ((uint32_t *)sub->rects[0]->pict.data[1])[i] |= 0xff000000; 116 } else { 117 for (i = 0; i < sub->rects[0]->nb_colors; i++) 118 ((uint32_t *)sub->rects[0]->pict.data[1])[i] |= *buf++ << 24; 119 } 113 120 114 121 // process RLE-compressed data
Note:
See TracChangeset
for help on using the changeset viewer.