On Mon, May 28, 2018 at 08:27:07PM +0200, Stephan Holljes wrote: > Signed-off-by: Stephan Holljes <[email protected]> > --- > segment.c | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > > diff --git a/segment.c b/segment.c > index c40d1ad..986aeb5 100644 > --- a/segment.c > +++ b/segment.c > @@ -82,6 +82,10 @@ int segment_write(void *opaque, unsigned char *buf, int > buf_size) > struct Segment *seg = (struct Segment*) opaque; > seg->size += buf_size; > seg->buf = (unsigned char*) av_realloc(seg->buf, seg->size); > + if (!seg->buf) { > + av_log(NULL, AV_LOG_ERROR, "Could not grow segment.\n"); > + return AVERROR(ENOMEM); > + } > memcpy(seg->buf + seg->size - buf_size, buf, buf_size); > return buf_size; > } > @@ -110,6 +114,10 @@ void segment_init(struct Segment **seg_p, > AVFormatContext *fmt) > int i; > AVStream *in_stream, *out_stream; > struct Segment *seg = (struct Segment*) av_malloc(sizeof(struct > Segment)); > + if (!seg) { > + av_log(fmt, AV_LOG_ERROR, "Could not allocate segment.\n"); > + return; > + }
i didnt look at the surrounding code but just from the patch segment_init fails and its void, not returning an error, that seems odd does this work ? [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB No human being will ever know the Truth, for even if they happen to say it by chance, they would not even known they had done so. -- Xenophanes
signature.asc
Description: PGP signature
_______________________________________________ ffmpeg-devel mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
