diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-03-06 23:53:36 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-03-06 23:53:36 +0100 |
commit | 39f5003a07db14c3a98617c052570383c6c0fd35 (patch) | |
tree | 72ba9057a2d27d6bced3de1d0e5c8141c5399c3c | |
parent | 618d2262d71e3eca9e01b2d03d0a7d5946737cf0 (diff) | |
parent | 5b977c1d4fd99f325049d48fb8f0a3240d50eef8 (diff) | |
download | ffmpeg-39f5003a07db14c3a98617c052570383c6c0fd35.tar.gz |
Merge commit '5b977c1d4fd99f325049d48fb8f0a3240d50eef8'
* commit '5b977c1d4fd99f325049d48fb8f0a3240d50eef8':
mxf: Return meaningful errors
Conflicts:
libavformat/mxfdec.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/mxfdec.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index c68387b5c6..31d6d463ba 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -2297,16 +2297,16 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt) { KLVPacket klv; MXFContext *mxf = s->priv_data; + int ret; - while (klv_read_packet(&klv, s->pb) == 0) { - int ret; + while ((ret = klv_read_packet(&klv, s->pb)) == 0) { PRINT_KEY(s, "read packet", klv.key); av_dlog(s, "size %"PRIu64" offset %#"PRIx64"\n", klv.length, klv.offset); if (IS_KLV_KEY(klv.key, mxf_encrypted_triplet_key)) { ret = mxf_decrypt_triplet(s, pkt, &klv); if (ret < 0) { av_log(s, AV_LOG_ERROR, "invalid encoded triplet\n"); - return AVERROR_INVALIDDATA; + return ret; } return 0; } @@ -2345,9 +2345,11 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt) /* check for 8 channels AES3 element */ if (klv.key[12] == 0x06 && klv.key[13] == 0x01 && klv.key[14] == 0x10) { - if (mxf_get_d10_aes3_packet(s->pb, s->streams[index], pkt, klv.length) < 0) { + ret = mxf_get_d10_aes3_packet(s->pb, s->streams[index], + pkt, klv.length); + if (ret < 0) { av_log(s, AV_LOG_ERROR, "error reading D-10 aes3 frame\n"); - return AVERROR_INVALIDDATA; + return ret; } } else { ret = av_get_packet(s->pb, pkt, klv.length); @@ -2373,7 +2375,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt) pkt->pts = mxf->current_edit_unit; } } else if (codec->codec_type == AVMEDIA_TYPE_AUDIO) { - int ret = mxf_set_audio_pts(mxf, codec, pkt); + ret = mxf_set_audio_pts(mxf, codec, pkt); if (ret < 0) return ret; } @@ -2386,7 +2388,7 @@ static int mxf_read_packet_old(AVFormatContext *s, AVPacket *pkt) skip: avio_skip(s->pb, klv.length); } - return url_feof(s->pb) ? AVERROR_EOF : -1; + return url_feof(s->pb) ? AVERROR_EOF : ret; } static int mxf_read_packet(AVFormatContext *s, AVPacket *pkt) |