changeset 36528:0dca7cd2b32b

rawdv: Fix memory leak in error case.
author reimar
date Sun, 19 Jan 2014 11:13:01 +0000
parents 6d2f5a28c064
children 1dbe3aa368ba
files libmpdemux/demux_rawdv.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_rawdv.c	Sun Jan 19 10:53:03 2014 +0000
+++ b/libmpdemux/demux_rawdv.c	Sun Jan 19 11:13:01 2014 +0000
@@ -121,8 +121,10 @@
 
    dp_video=new_demux_packet(frames->frame_size);
    bytes_read=stream_read(demuxer->stream,dp_video->buffer,frames->frame_size);
-   if (bytes_read<frames->frame_size)
+   if (bytes_read<frames->frame_size) {
+      free_demux_packet(dp_video);
       return 0;
+   }
    dp_video->pts=frames->current_frame/sh_video->fps;
    dp_video->pos=frames->current_filepos;
    dp_video->flags=0;