|
|
@ -59,6 +59,9 @@ read_header: |
|
|
|
s->restart_count = 0; |
|
|
|
s->restart_count = 0; |
|
|
|
s->mjpb_skiptosod = 0; |
|
|
|
s->mjpb_skiptosod = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (buf_end - buf_ptr >= 1 << 28) |
|
|
|
|
|
|
|
return AVERROR_INVALIDDATA; |
|
|
|
|
|
|
|
|
|
|
|
init_get_bits(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr)*8); |
|
|
|
init_get_bits(&hgb, buf_ptr, /*buf_size*/(buf_end - buf_ptr)*8); |
|
|
|
|
|
|
|
|
|
|
|
skip_bits(&hgb, 32); /* reserved zeros */ |
|
|
|
skip_bits(&hgb, 32); /* reserved zeros */ |
|
|
@ -111,8 +114,8 @@ read_header: |
|
|
|
av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%x\n", sod_offs); |
|
|
|
av_log(avctx, AV_LOG_DEBUG, "sod offs: 0x%x\n", sod_offs); |
|
|
|
if (sos_offs) |
|
|
|
if (sos_offs) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// init_get_bits(&s->gb, buf+sos_offs, (buf_end - (buf+sos_offs))*8);
|
|
|
|
init_get_bits(&s->gb, buf_ptr + sos_offs, |
|
|
|
init_get_bits(&s->gb, buf_ptr+sos_offs, field_size*8); |
|
|
|
8 * FFMIN(field_size, buf_end - buf_ptr - sos_offs)); |
|
|
|
s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16)); |
|
|
|
s->mjpb_skiptosod = (sod_offs - sos_offs - show_bits(&s->gb, 16)); |
|
|
|
s->start_code = SOS; |
|
|
|
s->start_code = SOS; |
|
|
|
if (ff_mjpeg_decode_sos(s, NULL, NULL) < 0 && |
|
|
|
if (ff_mjpeg_decode_sos(s, NULL, NULL) < 0 && |
|
|
|