return AVERROR_BUG;
}
+ if (s->avctx->skip_frame == AVDISCARD_ALL) {
+ s->picture_ptr->pict_type = AV_PICTURE_TYPE_I;
+ s->picture_ptr->key_frame = 1;
+ s->got_picture = 1;
+ return 0;
+ }
+
av_frame_unref(s->picture_ptr);
if (ff_get_buffer(s->avctx, s->picture_ptr, AV_GET_BUFFER_FLAG_REF) < 0)
return -1;
return AVERROR_INVALIDDATA;
}
- if (!Al) {
- // s->coefs_finished is a bitmask for coefficients coded
- // ss and se are parameters telling start and end coefficients
- s->coefs_finished[c] |= (2ULL << se) - (1ULL << ss);
- last_scan = !~s->coefs_finished[c];
- }
+ // s->coefs_finished is a bitmask for coefficients coded
+ // ss and se are parameters telling start and end coefficients
+ s->coefs_finished[c] |= (2ULL << se) - (1ULL << ss);
+ last_scan = !Al && !~s->coefs_finished[c];
if (s->interlaced && s->bottom_field)
data += linesize >> 1;
goto out;
}
- if (id == AV_RB32("Adob") && (get_bits(&s->gb, 8) == 'e')) {
+ if ( id == AV_RB32("Adob")
+ && len >= 7
+ && show_bits(&s->gb, 8) == 'e'
+ && show_bits_long(&s->gb, 32) != AV_RB32("e_CM")) {
+ skip_bits(&s->gb, 8); /* 'e' */
skip_bits(&s->gb, 16); /* version */
skip_bits(&s->gb, 16); /* flags0 */
skip_bits(&s->gb, 16); /* flags1 */
avctx->pix_fmt == AV_PIX_FMT_GBRAP
);
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
- for (p = 0; p<4; p++) {
+ av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format));
+ for (p = 0; p<s->nb_components; p++) {
uint8_t *line = s->picture_ptr->data[p];
int w = s->width;
int h = s->height;
avctx->pix_fmt == AV_PIX_FMT_GBRAP
);
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
- for (p = 0; p < 4; p++) {
+ av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format));
+ for (p = 0; p < s->nb_components; p++) {
uint8_t *dst;
int w = s->width;
int h = s->height;
if (s->flipped) {
int j;
avcodec_get_chroma_sub_sample(s->avctx->pix_fmt, &hshift, &vshift);
- for (index=0; index<4; index++) {
+ av_assert0(s->nb_components == av_pix_fmt_count_planes(s->picture_ptr->format));
+ for (index=0; index<s->nb_components; index++) {
uint8_t *dst = s->picture_ptr->data[index];
int w = s->picture_ptr->width;
int h = s->picture_ptr->height;
if (s->adobe_transform == 0 && s->avctx->pix_fmt == AV_PIX_FMT_GBRAP) {
int w = s->picture_ptr->width;
int h = s->picture_ptr->height;
+ av_assert0(s->nb_components == 4);
for (i=0; i<h; i++) {
int j;
uint8_t *dst[4];
if (s->adobe_transform == 2 && s->avctx->pix_fmt == AV_PIX_FMT_YUVA444P) {
int w = s->picture_ptr->width;
int h = s->picture_ptr->height;
+ av_assert0(s->nb_components == 4);
for (i=0; i<h; i++) {
int j;
uint8_t *dst[4];