[FFmpeg-devel] [PATCH] dpx: Make start offset unsigned

Paul B Mahol onemda at gmail.com
Sun Aug 5 02:09:45 CEST 2012


On 8/4/12, Derek Buitenhuis <derek.buitenhuis at gmail.com> wrote:
> Some corrupted files would end up with a negative offset,
> and segfault.
>
> Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
> ---
>  libavcodec/dpx.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
> index 6ef2db2..791e66a 100644
> --- a/libavcodec/dpx.c
> +++ b/libavcodec/dpx.c
> @@ -62,7 +62,8 @@ static int decode_frame(AVCodecContext *avctx,
>      AVFrame *const p = &s->picture;
>      uint8_t *ptr;
>
> -    int magic_num, offset, endian;
> +    unsigned int offset;
> +    int magic_num, endian;
>      int x, y;
>      int w, h, stride, bits_per_color, descriptor, elements,
> target_packet_size, source_packet_size;
>

uint32_t may be even better.


More information about the ffmpeg-devel mailing list