1
mirror of https://github.com/mpv-player/mpv synced 2024-11-18 21:16:10 +01:00

player: remove extremely obscure undefined behavior

Apparently the value of a pointer is "indeterminate" after a free()
call, even if you never dereference the pointer after the free. Since
talloc_free() calls free(), this applies here.
This commit is contained in:
wm4 2014-05-02 14:44:53 +02:00
parent 2386e183fe
commit d81a374c89

View File

@ -326,9 +326,10 @@ static int decode_image(struct MPContext *mpctx)
1 : check_framedrop(mpctx, -1);
d_video->waiting_decoded_mpi =
video_decode(d_video, pkt, framedrop_type);
bool had_packet = !!pkt;
talloc_free(pkt);
return !!pkt;
return had_packet;
}