On Mon, Dec 03, 2012 at 11:55:10AM -0500, Justin Ruggles wrote: > From: Michael Niedermayer <[email protected]> > > Signed-off-by: Michael Niedermayer <[email protected]> > Signed-off-by: Justin Ruggles <[email protected]> > --- > libavcodec/parser.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/libavcodec/parser.c b/libavcodec/parser.c > index 7ace766..5e559f7 100644 > --- a/libavcodec/parser.c > +++ b/libavcodec/parser.c > @@ -254,7 +254,9 @@ int ff_combine_frame(ParseContext *pc, int next, const > uint8_t **buf, int *buf_s > if(!new_buffer) > return AVERROR(ENOMEM); > pc->buffer = new_buffer; > - memcpy(&pc->buffer[pc->index], *buf, next + > FF_INPUT_BUFFER_PADDING_SIZE ); > + if (FF_INPUT_BUFFER_PADDING_SIZE > -next) > + memcpy(&pc->buffer[pc->index], *buf, > + next + FF_INPUT_BUFFER_PADDING_SIZE); > pc->index = 0; > *buf= pc->buffer; > } > --
Probably OK but the condition looks extremely WTFy. Can it be rearranged into something more intuitive, e.g. next > -FF_INPUT_PADDING_SIZE or anything else by your or Diego's choice? _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
