On Fri, Feb 27, 2015 at 03:42:44AM +0530, Himangi Saraogi wrote:
> --- a/libavcodec/pcxenc.c
> +++ b/libavcodec/pcxenc.c
> @@ -112,7 +112,7 @@ static int pcx_encode_frame(AVCodecContext *avctx,
> AVPacket *pkt,
>
> if (avctx->width > 65535 || avctx->height > 65535) {
> av_log(avctx, AV_LOG_ERROR, "image dimensions do not fit in 16
> bits\n");
> - return -1;
> + return AVERROR_INVALIDDATA;
> }
This is an encoder so this is set by the user --> EINVAL.
> @@ -136,8 +136,8 @@ static int pcx_encode_frame(AVCodecContext *avctx,
> AVPacket *pkt,
> pal = monoblack_pal;
> break;
> default:
> - av_log(avctx, AV_LOG_ERROR, "unsupported pixfmt\n");
> - return -1;
> + avpriv_request_sample(avctx, "Pixel format %d", avctx->pix_fmt);
> + return AVERROR_PATCHWELCOME;
> }
Same; this is a user-supplied value.
> line_bytes = (avctx->width * bpp + 7) >> 3;
> @@ -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(EINVAL);
> }
Not sure what to return here, but EINVAL looks fishy.
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel