History

avcodec/svq3: Improve returned error codes

Andreas Rheinhardt committed 1 year ago

Commit cb54eca1 parent 0468b861 file · +7 −5Browse files

Unified · Split

libavcodec/svq3.c+7−5
@@ -1225,7 +1225,7 @@ static av_cold int svq3_decode_extradata(AVCodecContext *avctx, SVQ3Context *s, · 1224 unmodified lines
1225 av_log(avctx, AV_LOG_ERROR,1225 av_log(avctx, AV_LOG_ERROR,
1226 "could not uncompress watermark logo\n");1226 "could not uncompress watermark logo\n");
1227 av_free(buf);1227 av_free(buf);
1228 return -1;1228 return AVERROR_EXTERNAL;
1229 }1229 }
1230 s->watermark_key = av_bswap16(av_crc(av_crc_get_table(AV_CRC_16_CCITT), 0, buf, buf_len));1230 s->watermark_key = av_bswap16(av_crc(av_crc_get_table(AV_CRC_16_CCITT), 0, buf, buf_len));
1231 1231
@@ -1403,8 +1403,9 @@ static int svq3_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 171 unmodified lines
1403 if (ret < 0)1403 if (ret < 0)
1404 return ret;1404 return ret;
1405 1405
1406 if (svq3_decode_slice_header(avctx))1406 ret = svq3_decode_slice_header(avctx);
1407 return -1;1407 if (ret < 0)
1408 return ret;
1408 1409
1409 if (avpkt->size < s->mb_width * s->mb_height / 8)1410 if (avpkt->size < s->mb_width * s->mb_height / 8)
1410 return AVERROR_INVALIDDATA;1411 return AVERROR_INVALIDDATA;
@@ -1517,8 +1518,9 @@ static int svq3_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 106 unmodified lines
1517 if (((get_bits_count(&s->gb_slice) & 7) == 0 ||1518 if (((get_bits_count(&s->gb_slice) & 7) == 0 ||
1518 show_bits(&s->gb_slice, get_bits_left(&s->gb_slice) & 7) == 0)) {1519 show_bits(&s->gb_slice, get_bits_left(&s->gb_slice) & 7) == 0)) {
1519 1520
1520 if (svq3_decode_slice_header(avctx))1521 ret = svq3_decode_slice_header(avctx);
1521 return -1;1522 if (ret < 0)
1523 return ret;
1522 }1524 }
1523 if (s->slice_type != s->pict_type) {1525 if (s->slice_type != s->pict_type) {
1524 avpriv_request_sample(avctx, "non constant slice type");1526 avpriv_request_sample(avctx, "non constant slice type");

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t