[FFmpeg-devel] [PATCH 4/8] libutvideodec: original_format is big endian

Reimar Döffinger Reimar.Doeffinger at gmx.de
Mon Nov 7 19:21:39 CET 2011


On Mon, Nov 07, 2011 at 12:20:25PM -0500, Derek Buitenhuis wrote:
> The original_format member of Ut Video's extradata is big
> endian, so read it as such, to prevent possible swaps later
> on.
> 
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> ---
>  libavcodec/libutvideo.cpp |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/libavcodec/libutvideo.cpp b/libavcodec/libutvideo.cpp
> index a313cde..b35fb85 100644
> --- a/libavcodec/libutvideo.cpp
> +++ b/libavcodec/libutvideo.cpp
> @@ -61,7 +61,7 @@ static av_cold int utvideo_decode_init(AVCodecContext *avctx)
>  
>      /* Read extradata */
>      info.version = AV_RL32(avctx->extradata);
> -    info.original_format = AV_RL32(avctx->extradata + 4);
> +    info.original_format = AV_RB32(avctx->extradata + 4);
>      info.frameinfo_size = AV_RL32(avctx->extradata + 8);
>      info.flags = AV_RL32(avctx->extradata + 12);

The (broken) way this is currently, this will actually change the data
that DecodeBegin gets, so one of these should be plain out wrong.
Has someone ever tried to use libutvideo on big-endian?
How about this wrapper?


More information about the ffmpeg-devel mailing list