| 575 | } |
| 576 | |
| 577 | static int open_null_ctx(AVIOContext **ctx) |
| 578 | { |
| 579 | int buf_size = 32768; |
| 580 | uint8_t *buf = av_malloc(buf_size); |
| 581 | if (!buf) |
| 582 | return AVERROR(ENOMEM); |
| 583 | *ctx = avio_alloc_context(buf, buf_size, 1, NULL, NULL, NULL, NULL); |
| 584 | if (!*ctx) { |
| 585 | av_free(buf); |
| 586 | return AVERROR(ENOMEM); |
| 587 | } |
| 588 | return 0; |
| 589 | } |
| 590 | |
| 591 | static void close_null_ctxp(AVIOContext **pb) |
| 592 | { |
no test coverage detected