summaryrefslogtreecommitdiff
path: root/libavcodec/mpeg4videodec.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-10-02 12:21:13 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@outlook.com>2023-10-05 22:05:21 +0200
commitca3dea8a36f15d551ad9b95d7cccee5a9ef23010 (patch)
tree918f7f7961b2abe90b3389fe3c435f0d62fbd33a /libavcodec/mpeg4videodec.c
parent49b4ed7237489a08e7b992e4be6ccf6ee055d043 (diff)
avcodec/h263dec, mpeg4videodec: Parse extradata during init
Possible now that the IDCT is already initialized at this point. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec/mpeg4videodec.c')
-rw-r--r--libavcodec/mpeg4videodec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index b24fe3db20..97aec68981 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -42,6 +42,7 @@
#include "h263.h"
#include "h263data.h"
#include "h263dec.h"
+#include "internal.h"
#include "profiles.h"
#include "qpeldsp.h"
#include "threadframe.h"
@@ -3828,6 +3829,14 @@ static av_cold int decode_init(AVCodecContext *avctx)
ff_thread_once(&init_static_once, mpeg4_init_static);
+ /* Must be after initializing the MPEG-4 static tables */
+ if (avctx->extradata_size && !avctx->internal->is_copy) {
+ GetBitContext gb;
+
+ if (init_get_bits8(&gb, avctx->extradata, avctx->extradata_size) >= 0)
+ ff_mpeg4_decode_picture_header(ctx, &gb, 1, 0);
+ }
+
return 0;
}