On 12/01/2013 03:10 PM, Justin Ruggles wrote:
> From: Michael Niedermayer <[email protected]>
> 
> Fixes null pointer dereference
> 
> Signed-off-by: Michael Niedermayer <[email protected]>
> Signed-off-by: Justin Ruggles <[email protected]>
> 
> CC:[email protected]
> ---
>  libavcodec/ljpegenc.c |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c
> index 4b13239..428a61b 100644
> --- a/libavcodec/ljpegenc.c
> +++ b/libavcodec/ljpegenc.c
> @@ -56,6 +56,13 @@ static int encode_picture_lossless(AVCodecContext *avctx, 
> AVPacket *pkt,
>          max_pkt_size += mb_width * mb_height * 3 * 4
>                          * s->mjpeg_hsample[0] * s->mjpeg_vsample[0];
>      }
> +
> +    if (!s->edge_emu_buffer &&
> +        (ret = ff_mpv_frame_size_alloc(s, pict->linesize[0])) < 0) {
> +        av_log(avctx, AV_LOG_ERROR, "failed to allocate context scratch 
> buffers.\n");
> +        return ret;
> +    }
> +
>      if ((ret = ff_alloc_packet(pkt, max_pkt_size)) < 0) {
>          av_log(avctx, AV_LOG_ERROR, "Error getting output packet of size 
> %d.\n", max_pkt_size);
>          return ret;

patch dropped. no longer needed.

-Justin
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to