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
1 changed files with 2 additions and 1 deletions

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;
}