diff options
author | wm4 <wm4@nowhere> | 2014-05-02 14:44:53 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-05-02 14:45:56 +0200 |
commit | d81a374c894d7f9fb4035f04fae786e43715c4a8 (patch) | |
tree | a0cfd56850f7e84e552b80610907f9647463ed18 | |
parent | 2386e183fed203af902213280ef866dd2aa870fb (diff) | |
download | mpv-d81a374c894d7f9fb4035f04fae786e43715c4a8.tar.bz2 mpv-d81a374c894d7f9fb4035f04fae786e43715c4a8.tar.xz |
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.
-rw-r--r-- | player/video.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/player/video.c b/player/video.c index 59acce0a19..1bb06ad0cc 100644 --- a/player/video.c +++ b/player/video.c @@ -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; } |