History

avcodec/mpeg4videodec: Bail out earlier when parsing

The scantables are unused for the parser (and in fact the IDCT permutation used has not been initialized at all).

Andreas Rheinhardt committed 1 year ago

Commit c0502691 parent f5f2c371 file · +6 −6Browse files

Showing the changes to libavcodec (1 of 1 file). Show all

Unified · Split

libavcodec/mpeg4videodec.c+6−6
@@ -3250,6 +3250,12 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb, · 3249 unmodified lines
3250 } else3250 } else
3251 s->alternate_scan = 0;3251 s->alternate_scan = 0;
3252 }3252 }
3253 /* Skip at this point when only parsing since the remaining
3254 * data is not useful for a parser and requires the
3255 * sprite_trajectory VLC to be initialized. */
3256 if (parse_only)
3257 goto end;
3258
3253 if (s->alternate_scan) {3259 if (s->alternate_scan) {
3254 ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan);3260 ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan);
3255 ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_vertical_scan,3261 ff_permute_scantable(s->permutated_intra_h_scantable, ff_alternate_vertical_scan,
@@ -3262,12 +3268,6 @@ static int decode_vop_header(Mpeg4DecContext *ctx, GetBitContext *gb, · 6 unmodified lines
3262 ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan,3268 ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan,
3263 s->idsp.idct_permutation);3269 s->idsp.idct_permutation);
3264 3270
3265 /* Skip at this point when only parsing since the remaining
3266 * data is not useful for a parser and requires the
3267 * sprite_trajectory VLC to be initialized. */
3268 if (parse_only)
3269 goto end;
3270
3271 if (s->pict_type == AV_PICTURE_TYPE_S) {3271 if (s->pict_type == AV_PICTURE_TYPE_S) {
3272 if((ctx->vol_sprite_usage == STATIC_SPRITE ||3272 if((ctx->vol_sprite_usage == STATIC_SPRITE ||
3273 ctx->vol_sprite_usage == GMC_SPRITE)) {3273 ctx->vol_sprite_usage == GMC_SPRITE)) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t