lavf/srtdec: do not try to queue empty subtitle chunks.
Regression since3af3a30. Fixes Ticket2167. (cherry picked from commitf2b6aabd3d)
This commit is contained in:
committed by
Carl Eugen Hoyos
parent
c2d2bf1d6b
commit
fb876e4572
@@ -100,6 +100,8 @@ static int srt_read_header(AVFormatContext *s)
|
|||||||
pts = get_pts(&ptr, &duration, &x1, &y1, &x2, &y2);
|
pts = get_pts(&ptr, &duration, &x1, &y1, &x2, &y2);
|
||||||
if (pts != AV_NOPTS_VALUE) {
|
if (pts != AV_NOPTS_VALUE) {
|
||||||
int len = buf.len - (ptr - buf.str);
|
int len = buf.len - (ptr - buf.str);
|
||||||
|
if (len <= 0)
|
||||||
|
continue;
|
||||||
sub = ff_subtitles_queue_insert(&srt->q, ptr, len, 0);
|
sub = ff_subtitles_queue_insert(&srt->q, ptr, len, 0);
|
||||||
if (!sub) {
|
if (!sub) {
|
||||||
res = AVERROR(ENOMEM);
|
res = AVERROR(ENOMEM);
|
||||||
|
|||||||
Reference in New Issue
Block a user