[FFmpeg-devel] [PATCH 1/2] png: split header state and data state in two separate variables.

Michael Niedermayer michael at niedermayer.cc
Thu Mar 30 00:53:25 EEST 2017

On Tue, Mar 28, 2017 at 07:37:54PM -0400, Ronald S. Bultje wrote:
> Fixes a reported (but false) race condition in tsan for fate-apng.
> ---
>  libavcodec/pngdec.c | 39 +++++++++++++++++++--------------------
>  1 file changed, 19 insertions(+), 20 deletions(-)
> diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
> index a4eb6cc..bbb9610 100644
> --- a/libavcodec/pngdec.c
> +++ b/libavcodec/pngdec.c
> @@ -45,7 +45,7 @@ typedef struct PNGDecContext {
>      ThreadFrame last_picture;
>      ThreadFrame picture;
> -    int state;
> +    int state, pstate;

I think its clearer if both variable names differ from the prior one
also the constants should be renamed consistently with the field names
they are used with. Otherwise its a bit confusing what constant belongs
to which state variable



Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20170329/bbe43700/attachment.sig>

More information about the ffmpeg-devel mailing list