1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-08-04 22:03:09 +02:00

avcodec/mediacodecdec: Reset optional fields when parse format

Parse format can be called multiple times, e.g., when resolution
changed. If getInt32 fails, optional member variables will retain
their previously set values without modification. This can be a
big problem for new resolution with old crop info.

This patch reset optional fields to zero when getInt32 failed.
This commit is contained in:
Zhao Zhili
2025-04-01 18:11:58 +08:00
parent 93ae305ce1
commit f702cf422a

View File

@ -537,6 +537,8 @@ static int mediacodec_wrap_sw_buffer(AVCodecContext *avctx,
av_log(avctx, AV_LOG_ERROR, "Could not get %s from format %s\n", key, format); \
ret = AVERROR_EXTERNAL; \
goto fail; \
} else { \
(name) = 0; \
} \
} while (0) \