[FFmpeg-cvslog] avcodec/mpeg4videodec: Use stack variable for aspect_ratio_info
Andreas Rheinhardt
git at videolan.org
Sat Jan 29 21:02:34 EET 2022
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Tue Jan 25 13:25:42 2022 +0100| [30dfd87da19b1ac3ce1db5558d84cc3f6d624c60] | committer: Andreas Rheinhardt
avcodec/mpeg4videodec: Use stack variable for aspect_ratio_info
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=30dfd87da19b1ac3ce1db5558d84cc3f6d624c60
---
libavcodec/mpeg4videodec.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 00bf7b6c4a..bdd320b1df 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -2215,7 +2215,7 @@ static void extension_and_user_data(MpegEncContext *s, GetBitContext *gb, int id
static int decode_studio_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
- int width, height;
+ int width, height, aspect_ratio_info;
int bits_per_raw_sample;
int rgb, chroma_format;
@@ -2270,12 +2270,12 @@ static int decode_studio_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
s->height = height;
}
}
- s->aspect_ratio_info = get_bits(gb, 4);
- if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) {
+ aspect_ratio_info = get_bits(gb, 4);
+ if (aspect_ratio_info == FF_ASPECT_EXTENDED) {
s->avctx->sample_aspect_ratio.num = get_bits(gb, 8); // par_width
s->avctx->sample_aspect_ratio.den = get_bits(gb, 8); // par_height
} else {
- s->avctx->sample_aspect_ratio = ff_h263_pixel_aspect[s->aspect_ratio_info];
+ s->avctx->sample_aspect_ratio = ff_h263_pixel_aspect[aspect_ratio_info];
}
skip_bits(gb, 4); /* frame_rate_code */
skip_bits(gb, 15); /* first_half_bit_rate */
@@ -2301,7 +2301,7 @@ static int decode_studio_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
{
MpegEncContext *s = &ctx->m;
- int width, height, vo_ver_id;
+ int width, height, vo_ver_id, aspect_ratio_info;
/* vol header */
skip_bits(gb, 1); /* random access */
@@ -2329,12 +2329,12 @@ static int decode_vol_header(Mpeg4DecContext *ctx, GetBitContext *gb)
} else {
vo_ver_id = 1;
}
- s->aspect_ratio_info = get_bits(gb, 4);
- if (s->aspect_ratio_info == FF_ASPECT_EXTENDED) {
+ aspect_ratio_info = get_bits(gb, 4);
+ if (aspect_ratio_info == FF_ASPECT_EXTENDED) {
s->avctx->sample_aspect_ratio.num = get_bits(gb, 8); // par_width
s->avctx->sample_aspect_ratio.den = get_bits(gb, 8); // par_height
} else {
- s->avctx->sample_aspect_ratio = ff_h263_pixel_aspect[s->aspect_ratio_info];
+ s->avctx->sample_aspect_ratio = ff_h263_pixel_aspect[aspect_ratio_info];
}
if ((ctx->vol_control_parameters = get_bits1(gb))) { /* vol control parameter */
More information about the ffmpeg-cvslog
mailing list