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
32503250 } else
32513251 s->alternate_scan = 0;
32523252 }
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+
32533259 if (s->alternate_scan) {
32543260 ff_init_scantable(s->idsp.idct_permutation, &s->intra_scantable, ff_alternate_vertical_scan);
32553261 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
32623268 ff_permute_scantable(s->permutated_intra_v_scantable, ff_alternate_vertical_scan,
32633269 s->idsp.idct_permutation);
32643270
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−
32713271 if (s->pict_type == AV_PICTURE_TYPE_S) {
32723272 if((ctx->vol_sprite_usage == STATIC_SPRITE ||
32733273 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