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
12251225 av_log(avctx, AV_LOG_ERROR,
12261226 "could not uncompress watermark logo\n");
12271227 av_free(buf);
1228− return -1;
1228+ return AVERROR_EXTERNAL;
12291229 }
12301230 s->watermark_key = av_bswap16(av_crc(av_crc_get_table(AV_CRC_16_CCITT), 0, buf, buf_len));
12311231
@@ -1403,8 +1403,9 @@ static int svq3_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 171 unmodified lines
14031403 if (ret < 0)
14041404 return ret;
14051405
1406− if (svq3_decode_slice_header(avctx))
1407− return -1;
1406+ ret = svq3_decode_slice_header(avctx);
1407+ if (ret < 0)
1408+ return ret;
14081409
14091410 if (avpkt->size < s->mb_width * s->mb_height / 8)
14101411 return AVERROR_INVALIDDATA;
@@ -1517,8 +1518,9 @@ static int svq3_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 106 unmodified lines
15171518 if (((get_bits_count(&s->gb_slice) & 7) == 0 ||
15181519 show_bits(&s->gb_slice, get_bits_left(&s->gb_slice) & 7) == 0)) {
15191520
1520− if (svq3_decode_slice_header(avctx))
1521− return -1;
1521+ ret = svq3_decode_slice_header(avctx);
1522+ if (ret < 0)
1523+ return ret;
15221524 }
15231525 if (s->slice_type != s->pict_type) {
15241526 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