Mercurial > mplayer.hg
comparison libmpdemux/demux_audio.c @ 17790:99a2481164ac
fix leak on read error (forgot to free demux packet)
author | reimar |
---|---|
date | Thu, 09 Mar 2006 22:14:34 +0000 |
parents | 28c2108f1cfa |
children | a2b85171b4de |
comparison
equal
deleted
inserted
replaced
17789:9f0c42967ce5 | 17790:99a2481164ac |
---|---|
420 stream_skip(s,-3); | 420 stream_skip(s,-3); |
421 } else { | 421 } else { |
422 dp = new_demux_packet(l); | 422 dp = new_demux_packet(l); |
423 memcpy(dp->buffer,hdr,4); | 423 memcpy(dp->buffer,hdr,4); |
424 if (stream_read(s,dp->buffer + 4,l-4) != l-4) | 424 if (stream_read(s,dp->buffer + 4,l-4) != l-4) |
425 { | |
426 free_demux_packet(dp); | |
425 return 0; | 427 return 0; |
428 } | |
426 priv->last_pts = priv->last_pts < 0 ? 0 : priv->last_pts + sh_audio->audio.dwScale/(float)sh_audio->samplerate; | 429 priv->last_pts = priv->last_pts < 0 ? 0 : priv->last_pts + sh_audio->audio.dwScale/(float)sh_audio->samplerate; |
427 break; | 430 break; |
428 } | 431 } |
429 } break; | 432 } break; |
430 case WAV : { | 433 case WAV : { |