1
mirror of https://git.videolan.org/git/ffmpeg.git synced 2024-10-14 12:24:49 +02:00

jpegls: return meaningful errors

This commit is contained in:
Luca Barbato 2013-05-17 12:36:06 +02:00
parent 2768f7e4fe
commit a5a0ef5e13

View File

@ -68,13 +68,13 @@ int ff_jpegls_decode_lse(MJpegDecodeContext *s)
case 2:
case 3:
av_log(s->avctx, AV_LOG_ERROR, "palette not supported\n");
return -1;
return AVERROR(ENOSYS);
case 4:
av_log(s->avctx, AV_LOG_ERROR, "oversize image not supported\n");
return -1;
return AVERROR(ENOSYS);
default:
av_log(s->avctx, AV_LOG_ERROR, "invalid id %d\n", id);
return -1;
return AVERROR_INVALIDDATA;
}
av_dlog(s->avctx, "ID=%i, T=%i,%i,%i\n", id, s->t1, s->t2, s->t3);
@ -346,11 +346,10 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near,
cur += s->picture_ptr->linesize[0];
}
} else if (ilv == 2) { /* sample interleaving */
av_log(s->avctx, AV_LOG_ERROR,
"Sample interleaved images are not supported.\n");
avpriv_report_missing_feature(s->avctx, "Sample interleaved images");
av_free(state);
av_free(zero);
return -1;
return AVERROR_PATCHWELCOME;
}
if (shift) { /* we need to do point transform or normalize samples */