[MPlayer-cvslog] r27841 - in trunk: libmpdemux/demux_mkv.c libmpdemux/stheader.h mencoder.c mplayer.c spudec.c spudec.h vobsub.c vobsub.h
Reimar Döffinger
Reimar.Doeffinger at stud.uni-karlsruhe.de
Thu Oct 30 18:35:39 CET 2008
On Mon, Oct 27, 2008 at 11:51:22PM +0100, aurel wrote:
> Log:
> Factorize vobsub idx/extradata handling.
I know, I forgot to comment further commenting on this but was it really
impossible to do this in a few smaller steps?
> @@ -973,6 +855,12 @@ vobsub_parse_one_line(vobsub_t *vob, rar
> if (line_size < 0) {
> break;
> }
> +
> + vob->extradata = realloc(vob->extradata, vob->extradata_len+line_size+1);
> + memcpy(vob->extradata+vob->extradata_len, line, line_size);
This seems very suspicious, are you really sure this can not go wrong?
> @@ -1115,11 +994,10 @@ vobsub_open(const char *const name,const
> /* NOOP */ ;
> rar_close(fd);
> }
> - /* if no palette in .idx then use custom colors */
> - if ((vob->custom == 0)&&(vob->have_palette!=1))
> - vob->custom = 1;
> - if (spu && vob->orig_frame_width && vob->orig_frame_height)
> - *spu = spudec_new_scaled_vobsub(vob->palette, vob->cuspal, vob->custom, vob->orig_frame_width, vob->orig_frame_height);
> + if (spu)
> + *spu = spudec_new_scaled(vob->palette, vob->orig_frame_width, vob->orig_frame_height, vob->extradata, vob->extradata_len);
> + if (vob->extradata)
> + free(vob->extradata);
Same about this, can there really never be a double free?
More information about the MPlayer-cvslog
mailing list