aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/parser.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2023-04-27 12:23:53 -0300
committerJames Almer <jamrial@gmail.com>2023-04-30 18:25:24 -0300
commit0275d994271ded88b3bf31b6d24686ecbc0e750d (patch)
tree8f73c3462e62669ae9242b57eb575d0dde4b3b57 /libavcodec/parser.c
parent7b2851b290f12cc8a1c8110b64bc5d364109873b (diff)
downloadffmpeg-0275d994271ded88b3bf31b6d24686ecbc0e750d.tar.gz
avcodec/parser: fill avctx dimensions if unset
This allows the usage of codecs in builds that have a parser but no decoders for remuxing scenarios with raw sources. Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavcodec/parser.c')
-rw-r--r--libavcodec/parser.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index 49de7e6a57..efc28b8918 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -166,6 +166,10 @@ int av_parser_parse2(AVCodecParserContext *s, AVCodecContext *avctx,
#define FILL(name) if(s->name > 0 && avctx->name <= 0) avctx->name = s->name
if (avctx->codec_type == AVMEDIA_TYPE_VIDEO) {
FILL(field_order);
+ FILL(coded_width);
+ FILL(coded_height);
+ FILL(width);
+ FILL(height);
}
/* update the file pointer */