On Fri, Feb 27, 2015 at 05:22:03AM +0530, Himangi Saraogi wrote:
> --- a/libavcodec/pcxenc.c
> +++ b/libavcodec/pcxenc.c
> @@ -176,7 +176,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, 
> AVPacket *pkt,
>          if ((written = pcx_rle_encode(buf, buf_end - buf,
>                                        src, line_bytes, nplanes)) < 0) {
>              av_log(avctx, AV_LOG_ERROR, "buffer too small\n");
> -            return -1;
> +            return AVERROR(EINVAL);
>          }
> @@ -185,7 +185,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, 
> AVPacket *pkt,
>      if (nplanes == 1 && bpp == 8) {
>          if (buf_end - buf < 257) {
>              av_log(avctx, AV_LOG_ERROR, "buffer too small\n");
> -            return -1;
> +            return AVERROR_INVALIDDATA;
>          }

Let's return AVERROR_BUG here when the encoder messes up buffer allocation.

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

Reply via email to