Browse Source

libavformat/utils: Warning about invalid cover art instead of an error

This way other streams can still be used with the -map option.

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n2.3
Lazaros Koromilas Michael Niedermayer 11 years ago
parent
commit
0f87b42b44
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      libavformat/utils.c

+ 6
- 2
libavformat/utils.c View File

@@ -517,8 +517,12 @@ int avformat_queue_attached_pictures(AVFormatContext *s)
if (s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC && if (s->streams[i]->disposition & AV_DISPOSITION_ATTACHED_PIC &&
s->streams[i]->discard < AVDISCARD_ALL) { s->streams[i]->discard < AVDISCARD_ALL) {
AVPacket copy = s->streams[i]->attached_pic; AVPacket copy = s->streams[i]->attached_pic;
if (copy.size <= 0)
return AVERROR(EINVAL);
if (copy.size <= 0) {
av_log(s, AV_LOG_WARNING,
"Attached picture on stream %d has invalid size, "
"ignoring\n", i);
continue;
}
copy.buf = av_buffer_ref(copy.buf); copy.buf = av_buffer_ref(copy.buf);
if (!copy.buf) if (!copy.buf)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);


Loading…
Cancel
Save