init_get_bits() takes a number of bits and not a number of bytes as
its size argument.
Signed-off-by: Alex Converse <alex.converse@gmail.com>
| ... | ... |
@@ -72,7 +72,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc, |
| 72 | 72 |
int pce_size = 0; |
| 73 | 73 |
uint8_t pce_data[MAX_PCE_SIZE]; |
| 74 | 74 |
if (!hdr.chan_config) {
|
| 75 |
- init_get_bits(&gb, buf, buf_size); |
|
| 75 |
+ init_get_bits(&gb, buf, buf_size * 8); |
|
| 76 | 76 |
if (get_bits(&gb, 3) != 5) {
|
| 77 | 77 |
av_log_missing_feature(avctx, "PCE based channel configuration, where the PCE is not the first syntax element is", 0); |
| 78 | 78 |
return -1; |
| ... | ... |
@@ -117,7 +117,7 @@ avs_decode_frame(AVCodecContext * avctx, |
| 117 | 117 |
table = buf + (256 * vect_w * vect_h); |
| 118 | 118 |
if (sub_type != AVS_I_FRAME) {
|
| 119 | 119 |
int map_size = ((318 / vect_w + 7) / 8) * (198 / vect_h); |
| 120 |
- init_get_bits(&change_map, table, map_size); |
|
| 120 |
+ init_get_bits(&change_map, table, map_size * 8); |
|
| 121 | 121 |
table += map_size; |
| 122 | 122 |
} |
| 123 | 123 |
|
| ... | ... |
@@ -150,7 +150,7 @@ static int decode_frame(AVCodecContext *avctx, |
| 150 | 150 |
|
| 151 | 151 |
if (video_type == 0 || video_type == 1) {
|
| 152 | 152 |
GetBitContext gb; |
| 153 |
- init_get_bits(&gb, buf, FFMIN(video_size, buf_end - buf)); |
|
| 153 |
+ init_get_bits(&gb, buf, FFMIN(video_size, (buf_end - buf) * 8)); |
|
| 154 | 154 |
|
| 155 | 155 |
for (j = 0; j < avctx->height; j += 8) |
| 156 | 156 |
for (i = 0; i < avctx->width; i += 8) |
| ... | ... |
@@ -1491,7 +1491,7 @@ int ff_rv34_decode_frame(AVCodecContext *avctx, |
| 1491 | 1491 |
av_log(avctx, AV_LOG_ERROR, "Slice offset is greater than frame size\n"); |
| 1492 | 1492 |
return -1; |
| 1493 | 1493 |
} |
| 1494 |
- init_get_bits(&s->gb, buf+get_slice_offset(avctx, slices_hdr, 0), buf_size-get_slice_offset(avctx, slices_hdr, 0)); |
|
| 1494 |
+ init_get_bits(&s->gb, buf+get_slice_offset(avctx, slices_hdr, 0), (buf_size-get_slice_offset(avctx, slices_hdr, 0))*8); |
|
| 1495 | 1495 |
if(r->parse_slice_header(r, &r->s.gb, &si) < 0 || si.start){
|
| 1496 | 1496 |
av_log(avctx, AV_LOG_ERROR, "First slice header is incorrect\n"); |
| 1497 | 1497 |
return -1; |
| ... | ... |
@@ -198,7 +198,7 @@ static av_cold int tta_decode_init(AVCodecContext * avctx) |
| 198 | 198 |
if (avctx->extradata_size < 30) |
| 199 | 199 |
return -1; |
| 200 | 200 |
|
| 201 |
- init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size); |
|
| 201 |
+ init_get_bits(&s->gb, avctx->extradata, avctx->extradata_size * 8); |
|
| 202 | 202 |
if (show_bits_long(&s->gb, 32) == AV_RL32("TTA1"))
|
| 203 | 203 |
{
|
| 204 | 204 |
/* signature */ |
| ... | ... |
@@ -208,7 +208,7 @@ static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track) |
| 208 | 208 |
avio_wb32(pb, 11); |
| 209 | 209 |
ffio_wfourcc(pb, "dac3"); |
| 210 | 210 |
|
| 211 |
- init_get_bits(&gbc, track->vosData+4, track->vosLen-4); |
|
| 211 |
+ init_get_bits(&gbc, track->vosData+4, (track->vosLen-4) * 8); |
|
| 212 | 212 |
fscod = get_bits(&gbc, 2); |
| 213 | 213 |
frmsizecod = get_bits(&gbc, 6); |
| 214 | 214 |
bsid = get_bits(&gbc, 5); |