Commit 73d820ee authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/xbmdec: remove dependancy on zero padding on input packet

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 103f9c26
......@@ -82,10 +82,10 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data,
return ret;
// goto start of image data
next = ptr + strcspn(ptr, "{");
if (!*next)
next = ptr + strcspn(ptr, "(");
if (!*next)
next = memchr(ptr, '{', avpkt->size);
if (!next)
next = memchr(ptr, '(', avpkt->size);
if (!next)
return AVERROR_INVALIDDATA;
ptr = next + 1;
......@@ -95,7 +95,10 @@ static int xbm_decode_frame(AVCodecContext *avctx, void *data,
for (j = 0; j < linesize; j++) {
uint8_t val;
ptr += strcspn(ptr, "x$") + 1;
while (ptr < end && *ptr != 'x' && *ptr != '$')
ptr++;
ptr ++;
if (ptr < end && av_isxdigit(*ptr)) {
val = convert(*ptr++);
if (av_isxdigit(*ptr))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment