Mercurial > libavcodec.hg
comparison dv.c @ 10320:44f31c1c9acc libavcodec
Make sure that dv encoder initializes all encoded packet data.
The specification does not say which value to use for unused
parts, so fill all unused bytes with 0xff, which is consistent
with what DV usually uses for reserved or unused parts.
author | reimar |
---|---|
date | Tue, 29 Sep 2009 19:17:18 +0000 |
parents | 38cfe222e1a4 |
children | 7f609ddb85bf |
comparison
equal
deleted
inserted
replaced
10319:9e43db5ad7ef | 10320:44f31c1c9acc |
---|---|
1100 pb = dv_encode_ac(&enc_blks[j], pb, &pbs[s->sys->bpm*5]); | 1100 pb = dv_encode_ac(&enc_blks[j], pb, &pbs[s->sys->bpm*5]); |
1101 if (enc_blks[j].partial_bit_count) | 1101 if (enc_blks[j].partial_bit_count) |
1102 av_log(NULL, AV_LOG_ERROR, "ac bitstream overflow\n"); | 1102 av_log(NULL, AV_LOG_ERROR, "ac bitstream overflow\n"); |
1103 } | 1103 } |
1104 | 1104 |
1105 for (j=0; j<5*s->sys->bpm; j++) | 1105 for (j=0; j<5*s->sys->bpm; j++) { |
1106 int pos; | |
1107 int size = pbs[j].size_in_bits >> 3; | |
1106 flush_put_bits(&pbs[j]); | 1108 flush_put_bits(&pbs[j]); |
1109 pos = put_bits_count(&pbs[j]) >> 3; | |
1110 if (pos > size) { | |
1111 av_log(avctx, AV_LOG_ERROR, "bitstream written beyond buffer size\n"); | |
1112 return -1; | |
1113 } | |
1114 memset(pbs[j].buf + pos, 0xff, size - pos); | |
1115 } | |
1107 | 1116 |
1108 return 0; | 1117 return 0; |
1109 } | 1118 } |
1110 | 1119 |
1111 #if CONFIG_DVVIDEO_DECODER | 1120 #if CONFIG_DVVIDEO_DECODER |