History

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.

Zhao Zhili committed 1 year ago

Commit f702cf41 parent 93ae3051 file · +2 −0Browse files

Unified · Split

libavcodec/mediacodecdec_common.c+2−0
@@ -537,6 +537,8 @@ static int mediacodec_wrap_sw_buffer(AVCodecContext *avctx, · 536 unmodified lines
537537 av_log(avctx, AV_LOG_ERROR, "Could not get %s from format %s\n", key, format); \
538538 ret = AVERROR_EXTERNAL; \
539539 goto fail; \
540+ } else { \
541+ (name) = 0; \
540542 } \
541543 } while (0) \
542544

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