[FFmpeg-devel] [PATCH] rawdec: fail in case of unknow pixel format

Michael Niedermayer michaelni at gmx.at
Mon May 30 02:05:12 CEST 2011


On Mon, May 30, 2011 at 01:43:17AM +0200, Stefano Sabatini wrote:
> ---
>  libavcodec/rawdec.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c
> index f8e119b..503351e 100644
> --- a/libavcodec/rawdec.c
> +++ b/libavcodec/rawdec.c
> @@ -97,6 +97,11 @@ static av_cold int raw_init_decoder(AVCodecContext *avctx)
>      else if (avctx->pix_fmt == PIX_FMT_NONE && avctx->bits_per_coded_sample)
>          avctx->pix_fmt = ff_find_pix_fmt(pix_fmt_bps_avi, avctx->bits_per_coded_sample);
>  
> +    if (avctx->pix_fmt == PIX_FMT_NONE) {
> +        av_log(avctx, AV_LOG_ERROR, "Pixel format was not specified and cannot be detected\n");
> +        return AVERROR(EINVAL);
> +    }

ok

btw, if you want its possible to implement autodetection of raw
pixfmt & size
just try all comon sizes & pix_fmts and compress as jpeg the one
compresssing best is likely the correct one

[..]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110530/b4f9e006/attachment.asc>


More information about the ffmpeg-devel mailing list