Overwrite cm->error->detail before freeing
authorWan-Teh Chang <wtc@google.com>
Fri, 24 Mar 2023 18:32:36 +0000 (11:32 -0700)
committerJames Zern <jzern@google.com>
Fri, 5 May 2023 05:08:21 +0000 (22:08 -0700)
commit3d6b86e7045481c55b35d0daa4f19202bbe99dc1
tree194c6ab0b6492a2328d10494d0139567d4d8c8ad
parent8e47341b0ea4bf2a37f968cf260d6dbfd1f0062a
Overwrite cm->error->detail before freeing

Help detect use after free of the return value of
vpx_codec_error_detail(). If vpx_codec_error_detail() is called after
vpx_codec_encode() fails, the return value may be equal to
cm->error->detail, which is freed when vpx_codec_destroy() is called.

Document the lifetime of the string returned by
vpx_codec_error_detail().

Change-Id: I8089e90a4499b4f3cc5b9cfdbb25d72368faa319
vp9/encoder/vp9_encoder.c
vpx/vpx_codec.h